:root {
  --bg: #fffaf3;
  --card: #ffffff;
  --text: #2b2622;
  --muted: #4f4740;        /* 보조 글자. 흰 카드 위 9.1:1, 크림 바탕 위 8.8:1(본문 #2b2622보다 한 단계 연하게) */
  --line: #d9cdbf;         /* 카드·목록 경계선 */
  --input-line: #cbbcaa;   /* 입력 칸 테두리(눌러서 쓰는 곳이라 조금 더 진하게) */
  /* 주황은 아래 두 줄에서만 정한다(바꾸면 버튼·주황 글자·첫 글자 칸이 함께 바뀐다) */
  --accent: #b94e17;       /* 주황 버튼·글자. 흰 글자 5.0:1, 크림 바탕 위 주황 글자 4.9:1 */
  --accent-soft: #fff1e6;  /* "사진 고르기" 버튼 바탕 */
  --accent-text: #ffffff;
  --error: #c0392b;
  --ok: #2e7d4f;
}

* { box-sizing: border-box; }

/* display를 지정한 요소(.add-row 등)에서도 hidden 속성이 항상 이기도록 */
[hidden] { display: none !important; }

html, body { margin: 0; }

/* 맨 위 제목에만 쓰는 넥슨 메이플스토리 서체. 넥슨이 배포한 파일을 고치거나 줄이지 않고 그대로 제공한다
   (라이선스: fonts/Maplestory-LICENSE.txt). 불러오는 동안에는 지금 글씨체로 먼저 보이고(swap) 다 받으면 바뀐다 */
@font-face {
  font-family: "Maplestory OTF";
  src: url("../fonts/Maplestory%20OTF%20Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.brand h1 {
  font-family: "Maplestory OTF", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  word-break: keep-all; /* 좁은 화면에서 줄이 바뀌어도 단어 중간에서 끊기지 않게 */
  margin: 8px 0 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  /* 크림 바탕과 흰 카드의 밝기가 거의 같아서 아주 옅은 그림자로 경계를 보탠다 */
  box-shadow: 0 1px 2px rgba(80, 50, 20, 0.06), 0 2px 10px rgba(80, 50, 20, 0.05);
}

.card h2 { font-size: 18px; margin: 0 0 6px; }

/* 보조 글자는 아이폰에서 가늘어 흐려 보여서 한 단계 굵게(500) */
.muted { color: var(--muted); font-weight: 500; margin: 0 0 16px; word-break: break-all; }

label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }

/* 16px 이상이어야 아이폰에서 입력할 때 화면이 확대되지 않는다 */
input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 12px 14px;
  border: 1px solid var(--input-line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  margin-bottom: 12px;
}

/* 입력 칸 안내 글자: 브라우저 기본값(연한 회색)은 흐려서 보조 글자 색으로 */
input::placeholder { color: var(--muted); font-weight: 500; opacity: 1; }

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

#input-code { letter-spacing: 0.3em; font-size: 22px; text-align: center; }

.btn {
  display: block;
  width: 100%;
  font: inherit;
  font-weight: 700;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.btn:disabled { opacity: 1; background: #efe8df; border-color: #e0d5c8; color: #6b6158; cursor: default; }

.btn.link {
  width: auto;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 500;
  padding: 8px 0;
  text-decoration: underline;
}

.row { display: flex; justify-content: space-between; margin-top: 8px; }

.msg { margin: 12px 4px 0; font-size: 14px; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--ok); }
.msg { white-space: pre-line; overflow-wrap: anywhere; }

.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;
}

.child-list { list-style: none; margin: 0 0 12px; padding: 0; }

.child-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.child-list li:first-child { border-top: 1px solid var(--line); }

.child-name { flex: 1; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }

.child-list input { margin: 0; flex: 1; min-width: 0; }

.btn.small {
  display: inline-block;
  width: auto;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.btn.danger { color: var(--error); }

.add-row { display: flex; gap: 8px; }
.add-row input { margin: 0; flex: 1; min-width: 0; }
.add-row .btn { width: auto; white-space: nowrap; }

.account {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 12px 4px 0;
}
.account .muted { margin: 0; font-size: 14px; }
.credit { margin: 4px 4px 0; text-align: right; color: var(--muted); font-size: 12px; font-weight: 500; }

.card + .card { margin-top: 12px; }

.hint { color: var(--muted); font-size: 13px; font-weight: 500; margin: -2px 0 6px; }
.hint.center { text-align: center; margin: 8px 0 0; }

select {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 12px 14px;
  border: 1px solid var(--input-line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  margin-bottom: 12px;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"] { min-height: 50px; -webkit-appearance: none; appearance: none; }
input[type="date"]:invalid, input[type="date"].empty { color: var(--muted); font-weight: 500; }

.child-count { color: var(--muted); font-size: 13px; font-weight: 500; margin-left: 4px; }

.upload-list { list-style: none; margin: 12px 0 0; padding: 0; }

.upload-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.upload-list img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--line);
  flex: none;
}

.upload-meta { flex: 1; min-width: 0; }
.upload-meta input[type="date"] { margin: 0; padding: 6px 8px; min-height: 0; font-size: 15px; }
.upload-state { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.upload-state.done { color: var(--ok); }
.upload-state.fail { color: var(--error); overflow-wrap: anywhere; }

.upload-remove {
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.upload-status { font-size: 14px; margin: 10px 0; min-height: 1em; }
.upload-status:empty { display: none; }

/* "사진 고르기": 눌러야 할 곳으로 보이게 주황 테두리·주황 글자 */
#btn-pick { margin-top: 4px; border: 2px solid var(--accent); color: var(--accent); background: var(--accent-soft); }

/* 날짜를 고르기 전에는 브라우저가 흐리게 보여주는 날짜를 숨기고 안내 문구를 덮는다 */
.date-wrap { position: relative; }
.date-placeholder {
  display: none;
  position: absolute;
  left: 15px;
  top: 0;
  height: 50px;
  line-height: 50px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 500;
  pointer-events: none;
}
.date-wrap input.empty { color: transparent; }
.date-wrap input.empty::-webkit-datetime-edit { color: transparent; }
.date-wrap input.empty + .date-placeholder { display: block; }

.load-error {
  border: 1px solid var(--error);
  border-radius: 12px;
  padding: 18px 16px;
  margin-bottom: 12px;
  text-align: center;
  background: #fff6f4;
}
.load-error p { margin: 0 0 12px; font-size: 15px; word-break: keep-all; }
.load-error .load-error-title { font-size: 18px; font-weight: 700; color: var(--error); margin-bottom: 6px; }
.load-error .btn { font-size: 17px; padding: 15px 16px; }
.load-error .hint { margin-top: 10px; overflow-wrap: anywhere; }

.trash { margin: 4px 0 12px; }
.trash summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 0;
}
.trash .hint { margin: 4px 0 8px; }
.trash .child-name { color: var(--muted); }

/* 아이 목록 한 줄: 썸네일 + 이름·그림 수 + "수정". 펼치면 아래에 이름 바꾸기와 휴지통 칸 */
.child-list li.child-item { display: block; }
.child-main { display: flex; align-items: center; gap: 12px; }
/* 썸네일 + 이름·그림 수: 누르면 그 아이의 그림 목록으로 */
.child-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.child-open:active .thumb { opacity: 0.7; }
.child-text { display: block; flex: 1; min-width: 0; }
.child-text .child-name { display: block; line-height: 1.35; }
.child-sub { display: block; color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 2px; }

/* 아이 그림은 네모난 도화지라 동그라미 대신 모서리만 둥근 네모에, 잘리지 않게 통째로 넣는다 */
.thumb {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f7f1e9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.thumb.letter { background: var(--accent-soft); color: var(--accent); font-size: 22px; font-weight: 800; }

.child-edit {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.child-danger {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  text-align: right;
}
.child-danger .confirm-text { margin: 0 0 4px; font-weight: 700; text-align: left; overflow-wrap: anywhere; }
.child-danger .hint { text-align: left; margin: 0 0 12px; word-break: keep-all; }
.confirm-row { display: flex; justify-content: flex-end; gap: 8px; }
.btn.danger-fill { background: var(--error); border-color: var(--error); color: #fff; }

/* 카드 제목 줄: 왼쪽 제목, 오른쪽 "+ 추가" */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.btn.small.head-btn { min-height: 44px; min-width: 76px; padding: 10px 16px; font-size: 15px; color: var(--accent); border-color: var(--accent); }
#form-child { margin-bottom: 16px; }

/* 아이별 그림 목록: 제목 아래 한 줄에 왼쪽 [목록], 오른쪽 [+ 그림] (둘 다 카드 밖) */
.gallery-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: -4px 0 12px; }
.gallery-actions .btn { width: auto; }
/* 이름과 "그림 n장"을 한 줄에. 이름이 길면 "…"로 줄이고 그림 수는 늘 보이게 */
.gallery-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
#gallery-name { flex: 1; min-width: 0; margin: 0; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-sub { flex: none; color: var(--muted); font-size: 15px; font-weight: 600; }
#gallery-note { margin: 10px 0 0; }
/* "+ 그림"으로 펼친 올리기 칸: 카드 안 맨 위, 아래 그림 목록과 구분되게 옅은 바탕 */
.gallery-upload { margin: 0 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.gallery-upload-title { font-size: 16px; margin: 0 0 12px; }
#leave-ask .hint { margin: -6px 0 16px; }
/* 공유(주인만): [공유] [+ 그림]은 오른쪽에 나란히. 공유 칸은 올리기 칸과 같은 모양 */
.gallery-actions-right { display: flex; gap: 8px; }
.share-panel .hint { word-break: keep-all; overflow-wrap: anywhere; }
.share-mine { margin: 0 0 12px; }
.share-mine span { font-weight: 700; color: var(--text); }
.share-list { list-style: none; margin: 0 0 16px; padding: 0; }
.share-item { padding: 12px 0; border-top: 1px solid var(--line); }
.share-item:last-child { border-bottom: 1px solid var(--line); }
.share-main { display: flex; align-items: center; gap: 8px; }
.share-email { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.share-badge { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #f3ebe1; color: var(--text); }
.share-badge.accepted { background: #e5f2ea; color: var(--ok); }
.share-item.declined .share-email { color: var(--muted); font-weight: 500; }
.share-item.declined .share-badge { background: #efe8df; color: var(--muted); }
.share-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.share-note { flex: 1; color: var(--muted); font-size: 13px; font-weight: 500; }
.role-pick { display: flex; gap: 6px; flex: 1; min-width: 0; }
#form-share .role-pick { margin-bottom: 8px; }
.btn.small.role-btn { flex: 1; min-height: 40px; padding: 8px 6px; border-color: var(--input-line); color: var(--muted); }
.btn.small.role-btn[aria-pressed="true"] { background: var(--accent-soft); border: 2px solid var(--accent); color: var(--accent); }
.share-row > .btn.danger { flex: none; min-height: 40px; }
.share-confirm { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.share-confirm .confirm-text { margin: 0 0 4px; font-weight: 700; }
.share-confirm .hint { margin: 0 0 10px; }
.share-count { color: var(--muted); font-weight: 500; }
/* 첫 화면·아이 화면 안내 띠: 크게 보기 띠와 같은 모양, 화면 맨 위 */
.viewer-toast.app-toast { top: calc(max(8px, env(safe-area-inset-top)) + 4px); z-index: 45; box-shadow: 0 2px 10px rgba(80, 50, 20, 0.12); }
/* 권한 이름표: 보기만(베이지) / 함께 편집(연한 주황) */
.role-tag { flex: none; display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #f3ebe1; color: var(--text); white-space: nowrap; }
.role-tag.edit { background: var(--accent-soft); color: var(--accent); }
.owner-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.owner-email { min-width: 0; color: var(--muted); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
/* 받은 공유 알림 */
.invite-card { border: 2px solid var(--accent); }
.invite-list { list-style: none; margin: 8px 0 0; padding: 0; }
.invite-item { padding: 12px 0; border-top: 1px solid var(--line); }
.invite-main { display: flex; align-items: center; gap: 8px; }
.invite-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.invite-from { margin: 2px 0 10px; color: var(--muted); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.invite-item .confirm-text { margin: 0 0 4px; font-weight: 700; }
.invite-item .hint { margin: 0 0 10px; word-break: keep-all; }
/* 공유받은 아이 화면 */
.gallery-owner { margin: -4px 0 10px; }
.gallery-owner .owner-line { margin-top: 0; }
#gallery-unshare { margin-top: 26px; }
#search-groups .owner-line { margin: -4px 0 8px; }
/* 보기만 크게 보기: 글로만 */
.viewer-read { margin-bottom: 8px; }
.viewer-read-title { margin: 0 0 6px; font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.viewer-read-story { margin: 0 0 10px; color: var(--muted); font-size: 15px; font-weight: 500; white-space: pre-line; overflow-wrap: anywhere; }
.viewer-read-meta { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; }
.share-foot { margin: 12px 0 0; }
#leave-ask-title { white-space: pre-line; }
.month { margin-top: 18px; }
.month h3 { font-size: 15px; margin: 0 0 8px; }
/* 정사각형 칸 안에 그림을 잘리지 않게 통째로 넣는다(JW 결정) */
.art-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.art-cell {
  padding: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f7f1e9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-cell img { display: block; width: 100%; height: 100%; object-fit: contain; }
.art-cell.broken { color: var(--muted); font-size: 11px; font-weight: 500; text-align: center; padding: 6px; word-break: keep-all; }

/* 크게 보기: 화면 전체. 위는 그림(어두운 바탕), 아래는 날짜·메모 칸 */
body.viewer-open { overflow: hidden; }
.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #1f1b18;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(8px, env(safe-area-inset-top)) 8px 4px 16px;
  color: #fff;
}
.viewer-count { font-size: 15px; font-weight: 600; }
.viewer-btn {
  width: 48px;
  height: 48px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.viewer-stage {
  position: relative;
  flex: none;
  height: 58vh;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}
.viewer-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.viewer-img img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-fail { color: #eee; font-size: 15px; }
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.viewer-nav.prev { left: 6px; }
.viewer-nav.next { right: 6px; }
.viewer-nav:disabled { visibility: hidden; }
.viewer-panel {
  flex: 1 0 auto;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 18px 16px max(20px, env(safe-area-inset-bottom));
  width: 100%;
  max-width: 480px;
  margin: 12px auto 0;
}
.viewer-panel input { margin-bottom: 4px; }
.viewer-why { color: var(--error); min-height: 0; margin: 0 0 10px; }
.viewer-why:empty { margin: 0 0 10px; }
.viewer-count-hint { text-align: right; margin: 0 0 12px; }
/* 크게 보기 안내 띠: 위쪽("3 / 4" 아래)에 떠 있어서 스크롤 위치와 상관없이 보인다 */
.viewer-toast {
  position: fixed;
  z-index: 55;
  top: calc(max(8px, env(safe-area-inset-top)) + 52px);
  left: 12px;
  right: 12px;
  max-width: 456px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.viewer-toast.ok { background: #e7f4ec; color: #1f5e3a; border: 1px solid #9fcfb2; }
.viewer-toast.error { background: #fdecea; color: #9b2c20; border: 1px solid #e3a59d; }
/* 저장하지 않은 내용 묻기: 크게 보기 위에 한 겹 */
.viewer-ask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.viewer-ask-box {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border-radius: 16px;
  padding: 20px 16px 12px;
  text-align: center;
}
.viewer-ask-title { font-size: 17px; font-weight: 700; margin: 0 0 16px; word-break: keep-all; }
.viewer-ask-box .btn + .btn { margin-top: 8px; }
.viewer-ask-box .btn.link { display: block; width: 100%; min-height: 44px; }

/* 크게 보기: 대표 그림 칸과 맨 아래 휴지통 칸 */
.viewer-cover { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.viewer-cover .btn:not(.small) { flex: 1; }
.viewer-cover-on { flex: 1; font-weight: 700; color: var(--accent); }
.viewer-danger { margin-top: 26px; }
/* 크게 보기: 제목·이야기 한 상자 두 줄. 윗줄 제목(굵고 크게), 아랫줄 이야기(작고 흐리게), 점선으로만 나눈다 */
.story-box {
  border: 1px solid var(--input-line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.story-box:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.story-box input,
.story-box textarea { display: block; width: 100%; border: 0; border-radius: 0; margin: 0; background: transparent; }
.story-box input:focus,
.story-box textarea:focus { outline: none; }
.viewer-panel .story-box input { margin: 0; }
#viewer-title { font-size: 19px; font-weight: 700; padding: 12px 14px 10px; border-bottom: 1px dashed var(--input-line); }
/* 16px 아래로 줄이면 아이폰에서 입력할 때 화면이 확대된다 */
#viewer-memo {
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  padding: 10px 14px 12px;
  min-height: 92px;
  resize: vertical;
}
#viewer-memo::placeholder { color: var(--muted); font-weight: 500; opacity: 0.85; }
.viewer-count-hint { margin: 6px 0 10px; }
.viewer-date-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.viewer-date-row input { flex: 1; min-width: 0; margin: 0; }
/* 아이 이름표: 주황 버튼과 헷갈리지 않게 연한 베이지 바탕 + 본문 갈색 글씨(누르는 단추 아님, JW 결정 2026-10-09) */
.viewer-child { flex: none; max-width: 45%; padding: 6px 12px; border-radius: 999px; background: #f3ebe1; color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-child:empty { display: none; }
.viewer-trashed { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #fdecea; color: #9b2c20; font-weight: 600; word-break: keep-all; }

/* #태그 단추 줄(크게 보기·찾기 칸 아래·찾기 결과의 아이 고르기) */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tag-btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.search-card { padding: 14px 16px 4px; }
.search-card .add-row { margin-bottom: 10px; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
.filter-row { margin-top: 4px; }
#search-title { flex: 1; min-width: 0; margin: 0; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#search-groups .month h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 그림 목록 아래 휴지통 */
.gallery-trash { margin-top: 22px; }
.gallery-trash .child-name { font-size: 15px; }
.gallery-trash .thumb img { opacity: 0.75; }

/* 내려받기(5번): 그림 목록 맨 아래 버튼, 누르면 그 자리에 올리기·공유 칸과 같은 모양의 칸 */
.btn.download-open { margin: 16px 0 12px; color: var(--accent); border-color: var(--accent); }
.gallery-upload.download-panel { margin: 16px 0 12px; }
.download-panel .download-text { margin: 0 0 10px; word-break: keep-all; overflow-wrap: anywhere; }
.download-panel .btn + .btn { margin-top: 8px; }
.download-status { margin: 0 0 10px; font-size: 15px; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.download-bar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; margin: 0 0 12px; }
.download-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.download-fail { margin: 0 0 12px; }
.download-panel .download-stop { display: block; margin: 12px 0 0 auto; }
