:root {
  /* 색은 여기서만 정한다(디자인 개선 2026-10-16, 주황은 2026-09-28 확정값 그대로) */
  --bg: #fff9f3;           /* 바탕 */
  --card: #ffffff;         /* 카드 */
  --text: #2b2522;         /* 본문 글자 */
  --muted: #74685f;        /* 보조 글자. 흰 카드 위 5.4:1, 바탕 위 5.1:1 */
  --line: #e3d6ca;         /* 카드 안 경계선·버튼 테두리 */
  --input-line: #cbbcaa;   /* 입력 칸 테두리(눌러서 쓰는 곳이라 조금 더 진하게) */
  --accent: #b94e17;       /* 포인트(주황) 버튼·글자. 흰 글자 5.0:1 (JW 확정, 바꾸지 않음) */
  --accent-soft: #fdebdd;  /* 포인트 연한 바탕 */
  --accent-on-soft: #a94614; /* 연한 바탕 위 주황 글자(#태그 칩·[함께 편집] 이름표). 연한 바탕 위 5.1:1(--accent는 4.35:1이라 조금 진하게) */
  --accent-text: #ffffff;
  --error: #c0392b;
  --ok: #2e7d4f;
  --radius-card: 20px;
  --shadow-card: 0 1px 2px rgba(80, 50, 30, .06), 0 4px 16px rgba(80, 50, 30, .06);
  --tap: 44px;             /* 버튼·누르는 곳 최소 높이 */
  --zoom-bg: #111111;      /* 전체 화면 보기 바탕(그림만 보이게 어둡게) */
  /* 잘라서 보여 주는 곳(아이 앨범 표지·홈 카드 동그라미)에서 그림의 어느 부분을 보일지: 가로 세로(%).
     세로 그림(꽃다발 등)은 위쪽이 더 보이게 위에서 35%(JW 결정 2026-10-17). 아이폰으로 보고 바꾸려면 여기 한 곳만 */
  --cover-pos: 50% 35%;
}

* { box-sizing: border-box; }

/* 선으로 된 아이콘(index.html 맨 위 svg 모음). 글자색을 따라간다 */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico {
  flex: none;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.ico.sm { width: 18px; height: 18px; }

/* 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));
}

/* 맨 위: 왼쪽 작은 "하늘스케치"(주황) + 그 아래 큰 "Kids Art Album"(제목 글씨체), 오른쪽 찾기·계정 아이콘 */
.brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 16px; }
.brand h1 { margin: 0; min-width: 0; font-weight: 700; word-break: keep-all; }
.brand-sub { display: block; font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: 0.02em; line-height: 1.3; }
.brand-main {
  display: block;
  font-family: "Maplestory OTF", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 24px;
  line-height: 1.25;
}
.brand-actions { flex: none; display: flex; gap: 2px; margin-right: -8px; }
/* 그림서랍 주소: 맨 위 제목 자리에 판매 사이트 로고 그림(functions/_middleware.js가 넣음). 높이는 하늘스케치 두 줄 제목(약 47px)에 맞춤 */
.brand h1.brand-logo { display: flex; align-items: center; min-height: 47px; line-height: 0; }
.brand-logo img { display: block; height: 40px; width: auto; max-width: 100%; }

/* 아이콘만 있는 버튼(이름은 aria-label로) */
.icon-btn {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active, .icon-btn[aria-expanded="true"] { background: var(--accent-soft); }

/* 테두리 없는 글자 버튼(주황) */
.text-btn {
  min-height: var(--tap);
  padding: 0 4px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}

/* 카드: 테두리 없이 흰 바탕 + 둥근 모서리 + 아주 옅은 그림자 */
.card {
  background: var(--card);
  border: 0;
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.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;
  min-height: var(--tap);
}

.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;
  min-height: var(--tap);
  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-panel { margin-bottom: 16px; }
.account-label { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.account-email { margin: 2px 0 14px; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.account-panel .policy-link { margin-top: 14px; }
.credit { margin: 6px 0 0; text-align: center; 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: var(--tap);
  height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  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; }

/* "사진 고르기": 눌러야 할 곳으로 보이게 주황 테두리·주황 글자 */

/* 날짜를 고르기 전에는 브라우저가 흐리게 보여주는 날짜를 숨기고 안내 문구를 덮는다 */
.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;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  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; }

/* 아이 화면 윗줄: 왼쪽 ‹, 오른쪽 공유·⋯ (맨 위 제목 대신) */
body[data-view="view-gallery"] .brand { display: none; }
.gallery-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: -4px -8px 8px; }
.gallery-actions-right { display: flex; gap: 2px; }
#gallery-note { margin: 12px 4px 0; }

/* ⋯ 메뉴(아래로 펼쳐지는 작은 카드) */
.menu-wrap { position: relative; }
.pop-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(80, 50, 30, .10), 0 10px 30px rgba(80, 50, 30, .16);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tap);
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.menu-item .ico { color: var(--muted); }
.menu-item:hover, .menu-item:focus-visible { background: var(--accent-soft); outline: none; }
.menu-item.danger, .menu-item.danger .ico { color: var(--error); }

/* 표지: 대표 그림(없으면 최근 그림)을 크게, 아래쪽 어두운 그라데이션 위에 이름(제목 글씨체)·그림 수 */
.album-cover {
  position: relative;
  height: 210px;
  border-radius: 24px;
  overflow: hidden;
  background: #fdebdd;
  box-shadow: var(--shadow-card);
}
.album-cover.c1 { background: #e6f0e4; }
.album-cover.c2 { background: #e3edf6; }
.album-cover.c3 { background: #fbe4ec; }
.album-cover-img { position: absolute; inset: 0; }
/* 표지는 그림을 넓게 잘라 보여 준다(보일 부분은 --cover-pos, 그림 전체는 아래 목록·크게 보기에서 잘리지 않게) */
.album-cover-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--cover-pos); }
.album-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(30, 18, 10, 0) 45%, rgba(30, 18, 10, .62) 100%);
  pointer-events: none;
}
.album-cover:not(.has-img)::after { background: linear-gradient(to bottom, rgba(30, 18, 10, 0) 35%, rgba(30, 18, 10, .45) 100%); }
/* 표지 전체를 덮는 투명 버튼(누르면 표지 그림 크게 보기). 이름·그림 수 글자는 그 위에 보이기만 한다 */
.album-cover-btn {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: zoom-in;
}
.album-cover-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* 대표 그림 고르기 모드: 화면 맨 위 띠(안내 + [취소]). 고르는 동안 지금 대표 그림 칸은 주황 테두리 */
.pick-bar {
  position: fixed;
  z-index: 50;
  top: calc(max(8px, env(safe-area-inset-top)) + 4px);
  left: 12px;
  right: 12px;
  max-width: 456px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: 14px;
  background: var(--card);
  border: 2px solid var(--accent);
  box-shadow: 0 4px 16px rgba(80, 50, 30, .18);
}
.pick-bar p { flex: 1; margin: 0; font-size: 15px; font-weight: 700; line-height: 1.4; word-break: keep-all; }
.pick-bar .btn { flex: none; min-height: var(--tap); }
.update-bar { z-index: 46; }   /* 새 버전 안내: 안내 띠(45) 위, 크게 보기(viewer)·시트보다는 아래 */
.picking .art-cell { cursor: pointer; }
.cover-picking .gallery-actions { visibility: hidden; }   /* 고르는 동안 ‹·공유·⋯는 숨김(띠의 [취소]로 끝낸다) */
.picking .art-cell.is-cover { outline: 3px solid var(--accent); outline-offset: -3px; }
.album-cover-text {
  position: absolute;
  z-index: 1;
  left: 20px;
  right: 18px;
  bottom: 16px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
#gallery-name {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: "Maplestory OTF", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 28px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-sub { flex: none; font-size: 15px; font-weight: 700; padding-bottom: 3px; }
.album { margin-top: 4px; }
/* 표지 아래 펼쳐지는 칸(공유·내려받기·휴지통·아이 정보 수정): 흰 카드 */
.album .panel { margin: 14px 0 0; padding: 16px; border: 0; border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow-card); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -8px -8px 4px 0; }
.panel-head .gallery-upload-title { margin: 0; }
#gallery-edit .child-edit { margin: 0; padding: 0; border: 0; background: none; }
.album > #gallery-loading, .album > #gallery-empty { margin: 16px 4px; }
.album > .load-error { margin-top: 14px; }
/* "+ 그림"으로 펼친 올리기 칸: 카드 안 맨 위, 아래 그림 목록과 구분되게 옅은 바탕 */
.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; }
/* 공유 칸(주인만) */
.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: var(--tap); 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: var(--tap); }
.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; }
/* 첫 화면·아이 화면 안내 띠: 크게 보기 띠와 같은 모양, 화면 맨 위 */
/* 오류 등 꼭 읽어야 하는 안내: 위쪽 버튼 줄(‹ ⋯ 등) 바로 아래 — 버튼을 가리지 않게(JW 2026-11-12). 짧은 성공 안내는 아래쪽 .undo-bar */
.viewer-toast.app-toast { top: calc(max(8px, env(safe-area-inset-top)) + 60px); 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-on-soft); }
.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-card { padding: 14px 16px 6px; }
.invite-card h2 { font-size: 16px; margin: 0 0 4px; }
.invite-item { padding: 10px 0 8px; }
/* 공유 하나 = 두 줄. 첫 줄: 이름(길면 …) + 권한 + 오른쪽 [거절] [받기], 둘째 줄: 누가 공유했는지 */
.invite-main { display: flex; align-items: center; gap: 8px; }
.invite-name { flex: 1 1 auto; min-width: 2em; font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-main .confirm-row { flex: none; gap: 6px; }
.invite-main .btn.small { padding: 0 14px; }
.invite-from { margin: 2px 0 0; color: var(--muted); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.invite-item > .confirm-row { margin-top: 2px; }
.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; }
#search-groups .owner-line { margin: -4px 0 8px; }
.share-foot { margin: 12px 0 0; }
#leave-ask-title { white-space: pre-line; }
.month { margin-top: 22px; }
.month h3 { font-size: 16px; margin: 0 4px 10px; }
/* 정사각형 칸 안에 그림을 잘리지 않게 통째로 넣는다(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: 12px;
  border: 0;
  background: var(--card);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-cell img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* 격자 썸네일(앨범 안 보통·촘촘히, 첫 화면 찾기 결과, 휴대폰·PC)은 정사각형으로 꽉 채움 — 가장자리는 잘려도 됨, 가운데 기준(JW 2026-11-11·12).
   크게 보기·전체 화면은 원본 그대로 통째로("그림 안 자름" 원칙 그대로) */
.art-cell img { object-fit: cover; object-position: 50% 50%; }
.art-cell.broken { color: var(--muted); font-size: 11px; font-weight: 500; text-align: center; padding: 6px; word-break: keep-all; }
/* 앨범 안 촘촘히 보기(원장님용 ③, JW 결정 2026-11-08): 인스타 격자처럼 한 줄 5장·간격 좁게. 그림은 그대로 통째로(자르지 않음),
   칸 바탕만 옅게 해서 그림 사이 빈 곳이 덜 보이게. 월별 묶음·누르면 크게 보기는 그대로 */
.view-pick.gallery-view-pick { justify-content: flex-end; margin: 14px -8px -14px 0; }
#gallery-months.dense .art-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
#gallery-months.dense .art-cell { border-radius: 4px; background: #fbf4ec; }
#gallery-months.dense .art-cell.broken { font-size: 9px; padding: 2px; }

/* 크게 보기: 화면 전체. 위는 그림(어두운 바탕), 아래는 날짜·메모 칸 */
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-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;
  display: flex;
  align-items: center;
  justify-content: center;
}
.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-sheet-box 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; }
/* 휴지통으로 옮긴 뒤 아래쪽 짧은 띠 + [되돌리기](JW 2026-11-12): 위쪽 ⋯ 메뉴를 가리지 않게 아래에.
   앨범에서는 [+ 그림 올리기] 위, 크게 보기에서는 화면 아래 */
.undo-bar {
  position: fixed;
  z-index: 56;
  left: 12px;
  right: 12px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  max-width: 456px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 4px 6px 4px 16px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(40, 25, 15, 0.25);
}
.undo-bar[hidden] { display: none; }
body.viewer-open .undo-bar { bottom: calc(16px + env(safe-area-inset-bottom)); }
.undo-bar.error { background: #9b2c20; }
.undo-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.undo-btn {
  flex: none;
  min-height: var(--tap);
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #ffc9a3;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.undo-btn[hidden] { display: none; }
.undo-btn:focus-visible { outline: 2px solid #ffc9a3; outline-offset: 2px; }
/* 저장하지 않은 내용 묻기: 크게 보기 위에 한 겹 */
.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; }
/* 다른 앨범으로 옮기기(⑥): 내 앨범 목록(동그라미 + 이름 한 줄씩, 촘촘히 보기와 같은 모양), 많으면 상자 안에서 스크롤 */
.move-box { max-width: 380px; text-align: left; }
.move-box .viewer-ask-title { text-align: center; }
.move-list { max-height: min(52vh, 420px); overflow-y: auto; margin: -6px -4px 12px; }
.move-list[hidden] { display: none; }
.move-pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 4px 8px; border: 0; border-radius: 12px;
  background: none; color: var(--text); font: inherit; font-size: 16px; font-weight: 700; text-align: left; cursor: pointer; }
.move-pick + .move-pick { border-top: 1px solid var(--line); border-radius: 0; }
.move-pick:hover { background: var(--accent-soft); }
.move-pick .avatar { width: 40px; height: 40px; font-size: 17px; }
.move-pick .move-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-info { margin: -4px 0 14px; font-size: 15px; line-height: 1.55; word-break: keep-all; }
.move-msg { margin: 0 0 10px; }
.move-box .btn { width: 100%; }

/* 크게 보기: 제목·이야기 한 상자 두 줄. 윗줄 제목(굵고 크게), 아랫줄 이야기(작고 흐리게), 점선으로만 나눈다 */
.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-sheet-box .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: var(--tap);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-on-soft);
  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; }
#gallery-search-card { margin-bottom: 12px; }
.search-all { display: block; margin: -6px 0 6px; }
.search-all[hidden] { display: none; }
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: 14px; }
.gallery-trash .child-name { font-size: 15px; }
.gallery-trash .thumb img { opacity: 0.75; }

/* 내려받기(5번): ⋯ 메뉴로 여는 칸 */
.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; }

/* ---------- 개인정보 처리방침(privacy.html)과 처음 동의 화면 ---------- */
.policy-link { margin: 12px 0 0; text-align: center; font-size: 13px; font-weight: 500; }
.policy-link a, .policy-back a, .policy-body a, .consent a { color: var(--accent); font-weight: 600; }

.policy-back { margin: 0 0 4px; font-size: 15px; }
.policy-back.bottom { margin: 16px 4px 0; }
.policy-body { line-height: 1.65; word-break: keep-all; overflow-wrap: anywhere; }
.policy-body h2 { font-size: 20px; }
.policy-body h3 { font-size: 17px; margin: 28px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.policy-body h4 { font-size: 15px; margin: 16px 0 4px; }
.policy-body p { margin: 0 0 10px; }
.policy-body ul { margin: 0 0 10px; padding-left: 20px; }
.policy-body li { margin-bottom: 6px; }
.policy-body mark.todo { background: #fff1b8; color: #6b4a00; font-weight: 700; padding: 0 2px; border-radius: 3px; }
.table-scroll { overflow-x: auto; margin: 8px 0 12px; -webkit-overflow-scrolling: touch; }
.policy-table { border-collapse: collapse; font-size: 13px; line-height: 1.5; min-width: 560px; }
.policy-table.history { min-width: 0; width: 100%; }
.policy-table th, .policy-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.policy-table th { background: #f6efe6; white-space: nowrap; }

.consent .consent-item { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; font-weight: 700;
  margin: 16px 0 6px; cursor: pointer; word-break: keep-all; }
.consent .consent-item input { width: 24px; height: 24px; flex: 0 0 auto; margin: 0; accent-color: var(--accent); }
.consent-summary { margin: 0 0 6px 34px; padding: 10px 12px; background: #faf5ee; border-radius: 10px; font-size: 14px; }
.consent-summary dt { font-weight: 700; }
.consent-summary dd { margin: 0 0 6px; color: var(--muted); font-weight: 500; word-break: keep-all; }
.consent-summary dd:last-child { margin-bottom: 0; }
.consent .consent-note { margin: 0 0 6px 34px; }
.consent .policy-link { margin: 0 0 4px 34px; text-align: left; font-size: 14px; }
.consent #btn-consent { margin-top: 20px; }
.consent .consent-out { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.consent .consent-out .hint { margin: 0; overflow-wrap: anywhere; }

/* ---------- 첫 화면(디자인 1단계) ---------- */
.home-section { margin-top: 20px; }
.home-section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 4px 10px; }
.section-head h2 { margin: 0; font-size: 19px; }
.add-card { margin-bottom: 12px; }
.add-card .add-hint { margin: 0 0 10px; word-break: keep-all; }
/* 아이 0명 첫 화면의 환영 문구(제목 아래) */
.home-welcome { margin: 8px 4px 18px; word-break: keep-all; }
.home-welcome .welcome-title { margin: 0 0 6px; font-size: 22px; font-weight: 700; line-height: 1.4; }
.home-welcome .welcome-text { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); }
.home-welcome[hidden] { display: none; }
.add-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.add-head .icon-btn { margin: -8px -8px 0 0; }
/* 아이 카드 목록 맨 아래 점선 카드 "+ 아이 추가"("+ 첫 그림 올리기"와 같은 모양, JW 결정 2026-10-17) */
.add-kid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 64px;
  margin: 0 0 12px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-card);
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}
.add-kid[hidden] { display: none; }

.kid-list { list-style: none; margin: 0; padding: 0; }

/* 홈 앨범 보기 방식(JW 결정 2026-11-08): 목록 위 한 줄 = "앨범 n개" + [카드로 보기] [촘촘히 보기] */
.view-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px -8px 4px 0; }
.view-pick[hidden] { display: none; }
.view-pick-count { min-width: 0; padding-left: 4px; color: var(--muted); font-size: 14px; font-weight: 600; }
.view-pick-btns { flex: none; display: flex; gap: 2px; }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-on-soft); }
/* 촘촘히 보기: 카톡 대화 목록처럼 한 줄에 한 앨범. 흰 카드 하나 안에 줄을 잇고, 줄 사이는 옅은 선 */
.kid-list.compact:not(:empty) { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 4px 0; margin-bottom: 12px; }
.kid-list.compact .kid-card { background: none; box-shadow: none; border-radius: 0; margin: 0; padding: 4px 4px 4px 14px; }
.kid-list.compact .kid-card + .kid-card { border-top: 1px solid var(--line); }
.kid-list.compact .kid-card .child-open { min-height: 52px; }
.kid-list.compact .avatar { width: 40px; height: 40px; font-size: 17px; }
.kid-list.compact .kid-card .child-name { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kid-list.compact .kid-card .child-sub { margin-top: 0; }
.kid-list.compact .kid-card .owner-line { margin-top: 2px; }
.kid-list.compact .kid-card.open { padding-bottom: 12px; }
/* 찾기 결과의 앨범 줄: 이미 흰 카드 안이라 바깥 카드 모양은 빼고 줄만 */
.kid-list.compact.search-album-list:not(:empty) { background: none; box-shadow: none; border-radius: 0; padding: 0; margin: 0; }
.kid-list.compact.search-album-list .kid-card { padding-left: 0; }
.search-albums { margin-top: 12px; }

/* 아이 목록 순서 바꾸기(JW 결정 2026-10-18): 카드 목록 아래 작은 글자 버튼 → 카드마다 ↑↓ + 위쪽 띠 [완료] */
.reorder-btn { display: block; margin: 0 0 4px; }
.reorder-btn[hidden] { display: none; }
.kid-card.order-card { padding: 10px 8px 10px 16px; }
.order-card .child-open { cursor: default; }
.order-move { flex: none; }
.order-move:disabled { opacity: .3; cursor: default; }
.reorder-bar p { display: flex; flex-direction: column; }
.reorder-msg { font-size: 13px; font-weight: 600; color: var(--error); }
.reorder-msg:empty { display: none; }
body.reordering #view-home { padding-top: 16px; }   /* 위쪽 띠가 제목 줄을 덮고, 첫 카드는 띠 아래에서 시작 */
body.reordering #btn-open-account, body.reordering #account-panel, body.reordering #invite-card { display: none; }
.kid-card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 14px 12px 14px 16px;
  margin-bottom: 12px;
}
.kid-card .child-main { gap: 4px; }
.kid-card .child-open { gap: 12px; min-height: var(--tap); }
.kid-card .child-name { font-size: 18px; font-weight: 700; }
.avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-on-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}
/* 대표 그림을 정한 아이는 첫 글자 대신 그 그림(보일 부분은 표지와 같은 --cover-pos) */
.avatar.has-img { overflow: hidden; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--cover-pos); }
/* 첫 글자 동그라미 색 4가지(아이 id로 정함). 글자·바탕 대비 모두 4.5:1 이상 */
.avatar.c0 { background: #fdebdd; color: #a94614; }   /* 주황 5.07:1 */
.avatar.c1 { background: #e6f0e4; color: #3a7246; }   /* 초록 4.88:1 */
.avatar.c2 { background: #e3edf6; color: #36648f; }   /* 파랑 5.25:1 */
.avatar.c3 { background: #fbe4ec; color: #a3405f; }   /* 분홍 5.04:1 */
.kid-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 12px 4px 0 0; cursor: pointer; }
.kid-thumb { aspect-ratio: 1 / 1; border-radius: 12px; background: #f6efe7; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.kid-thumb.blank { background: none; }
/* 그림은 잘리지 않게 통째로(JW 결정 2026-09-28) */
.kid-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* 첫 화면 앨범 카드 최근 4장도 앨범 격자와 같은 정사각형 꽉 채움(가운데 기준, JW 2026-11-12) */
.kid-thumb img { object-fit: cover; object-position: 50% 50%; }
.first-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 4px);
  min-height: 64px;
  margin: 12px 4px 0 0;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}
.first-upload.empty { color: var(--muted); font-weight: 600; cursor: default; }
.kid-card .child-edit { margin-right: 4px; }

/* 아이 휴지통: 카드 목록 아래 작은 회색 글자 버튼. 펼치면 흰 칸 */
.home-section .trash { margin: 4px 0 0; }
.trash summary.trash-btn { list-style: none; display: inline-flex; gap: 6px; padding: 0 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.trash summary.trash-btn::-webkit-details-marker { display: none; }
.home-section .trash[open] { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 6px 16px 4px; }

/* 화면 아래 고정 [+ 그림 올리기] */
.fab {
  max-width: calc(100% - 32px);
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  height: 56px;
  padding: 0 26px 0 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 28px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(120, 50, 10, .28);
  cursor: pointer;
}
body.has-fab .wrap { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

/* 화면 전체 시트(그림 올리기) */
body.sheet-open { overflow: hidden; }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.sheet-top {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 8px 6px 16px;
  background: var(--bg);
}
.sheet-top h2 { margin: 0; font-size: 20px; }
.sheet-body { max-width: 480px; margin: 0 auto; padding: 8px 16px max(24px, env(safe-area-inset-bottom)); }
/* 초점 테두리: 키보드로 움직일 때만(:focus-visible) 주황 테두리. 손가락·마우스로 누를 때는 안 보인다.
   시트를 열 때 ✕로 초점을 옮기는 것도 손가락으로 열었으면 테두리가 없다(브라우저가 정한다) */
button:focus:not(:focus-visible), summary:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn:focus-visible { outline-offset: 0; }
.menu-item:focus-visible { outline: none; }
/* 마지막 입력이 손가락·마우스면(app.js가 <html>에 pointer-nav) 앱이 옮긴 초점에도 테두리·강조 바탕을 그리지 않는다(아이폰 사파리 대비) */
.pointer-nav button:focus-visible, .pointer-nav summary:focus-visible, .pointer-nav a:focus-visible { outline: none; }
.pointer-nav .menu-item:focus-visible:not(:hover) { background: none; }

.fab span { overflow: hidden; text-overflow: ellipsis; }
/* 첫 화면·아이 앨범 같은 규칙: 맨 위에서만 펼치고 내려가 있으면 오른쪽 아래 동그란 [+](56px)(위치로 정함, app.js). 자리(left)·글자 폭만 부드럽게 바뀐다 */
.fab { transition: left .22s ease, transform .22s ease, padding .22s ease, gap .22s ease; }
.fab span { max-width: 260px; transition: max-width .22s ease, opacity .15s ease; }
.fab.mini { left: calc(100% - 56px - max(16px, env(safe-area-inset-right))); transform: none; padding: 0 16px; gap: 0; }
.fab.mini span { max-width: 0; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .fab, .fab span { transition: none; } }

/* ---------- 크게 보기(디자인 3단계): 따뜻한 베이지 바탕, 액자 같은 그림, 아래 이야기 카드 ---------- */
.viewer { background: #f4ece3; color: var(--text); }
.viewer-top {
  display: grid;
  grid-template-columns: var(--tap) 1fr var(--tap);
  align-items: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: max(6px, env(safe-area-inset-top)) 8px 2px;
  color: var(--text);
}
.viewer-count { text-align: center; font-size: 15px; font-weight: 700; color: var(--text); }
.viewer-menu-wrap { justify-self: end; }
/* 그림은 "최대한 크게"(JW 결정, 작게 만들지 않는다): 높이를 고정하지 않고 그림 모양에 맞춘다.
   폭은 화면 폭 - 바깥 여백 8px씩 - 흰 액자 8px씩, 높이는 화면 높이에서 윗줄과 아래 이야기 카드 첫 줄·[이야기 편집]이
   보일 만큼(--viewer-reserve)을 뺀 만큼. 둘 중 먼저 닿는 쪽에 맞추고, 작은 사진도 그만큼 키운다(--ar = 가로/세로, 사진을 받으면 앱이 넣음).
   가로 그림은 그림 높이만큼만 차지해서 위아래가 비지 않는다. */
.viewer { --viewer-reserve: 236px; --viewer-h: max(220px, calc(100vh - var(--viewer-reserve))); }
@supports (height: 100dvh) { .viewer { --viewer-h: max(220px, calc(100dvh - var(--viewer-reserve))); } }
.viewer-stage { height: auto; min-height: 160px; padding: 4px 0 0; }
.viewer-frame {
  position: relative;
  display: block;
  width: -webkit-fit-content;
  width: fit-content;
  height: auto;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  line-height: 0;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
/* 그림 = 흰 여백 8px 액자 + 그림자. 사진이 없으면(불러오는 중) 액자도 안 보인다 */
.viewer-img img {
  box-sizing: content-box;
  width: min(calc(100vw - 32px), 944px, calc((var(--viewer-h) - 16px) * var(--ar, 1)));
  height: auto;
  max-width: none;
  max-height: none;
  padding: 8px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 2px 6px rgba(80, 50, 30, .10), 0 12px 30px rgba(80, 50, 30, .18);
}
.viewer-frame:focus-visible { outline-offset: 4px; }
/* 오른쪽 아래 모서리의 작은 돋보기(+): "누르면 크게 볼 수 있어요" 표시. 이름은 버튼(그림)이 대신 읽어 준다 */
.viewer-zoom-hint {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .86);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(43, 37, 34, .25);
  pointer-events: none;
}
.viewer-zoom-hint .ico { width: 18px; height: 18px; }
.viewer-fail { display: block; padding: 60px 0; color: var(--muted); font-weight: 600; line-height: 1.5; }
/* ‹ 7 / 10 ›: 넘기는 버튼은 위쪽 줄 가운데(그림을 가리지 않게). 첫·끝 그림이면 자리만 남기고 숨긴다 */
.viewer-pager { display: flex; align-items: center; justify-content: center; gap: 2px; min-width: 0; }
.viewer-pager .viewer-count { min-width: 64px; }
.viewer-pager .viewer-nav {
  position: static;
  transform: none;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

/* ---------- 전체 화면 보기: 어두운 바탕에 그림만 화면 가득(잘리지 않게), 원본 파일 ---------- */
.zoom {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--zoom-bg);
  color: #fff;
  overflow: hidden;
  touch-action: none;        /* 확대·이동·넘기기는 앱이 직접 처리(휴대폰이 화면 전체를 확대하지 않게) */
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
.zoom-stage {
  position: absolute;
  top: env(safe-area-inset-top);
  right: env(safe-area-inset-right);
  bottom: env(safe-area-inset-bottom);
  left: env(safe-area-inset-left);
  overflow: hidden;
}
/* 그림 칸은 그림 비율 그대로(앱이 화면에 맞춘 크기·자리를 넣는다). 칸이 화면 전체면 아이폰 길게 누르기 미리보기가 늘어나 보인다(2026-10-17) */
.zoom-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 50%;
  will-change: transform;
  -webkit-user-drag: none;
  -webkit-touch-callout: default;   /* 길게 누르면 휴대폰 메뉴(사진 앱에 저장 등). 막지 않는다(JW 결정 2026-10-17) */
}
/* 확대 중이거나 두 손가락 동작 중에는 길게 누르기 메뉴를 막는다(끌다가 멈췄을 때 메뉴가 끼어들지 않게) */
.zoom.zoomed .zoom-img, .zoom.pinching .zoom-img { -webkit-touch-callout: none; }
.zoom-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  /* ✕ | ‹ 7 / 10 › | 공유·저장: 가운데 칸은 내용만큼, 양옆은 남는 자리를 똑같이 나눔(320px에서는 오른쪽 버튼 둘만큼 넓어져 가운데가 조금 왼쪽으로) */
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 40px max(8px, env(safe-area-inset-left));
  /* 위쪽 줄 뒤에 위에서 아래로 투명해지는 어두운 띠: 그림 위에 겹쳐도(가로 화면 등) 글자가 잘 보이고, 아래로 갈수록 그림을 덜 가린다.
     그림 크기는 줄이지 않는다("최대한 크게") */
  background: linear-gradient(to bottom, rgba(0, 0, 0, .62) 0%, rgba(0, 0, 0, .42) 45%, rgba(0, 0, 0, .14) 78%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}
.zoom-top .ico { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.zoom-top button { pointer-events: auto; }
.zoom-top .icon-btn, .zoom-top .viewer-nav, .zoom-top .viewer-count { color: #fff; }
.zoom-top .viewer-count { text-align: center; font-size: 15px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.zoom-top .viewer-nav:disabled { visibility: hidden; }
.zoom-top > .icon-btn { justify-self: start; }
.zoom-actions { justify-self: end; display: flex; }
.zoom-save:disabled { opacity: .5; }
/* 이미지로 공유 미리보기 시트: 전체 화면(70) 위 */
.viewer-sheet.share-sheet { z-index: 75; }
.share-preview { display: flex; align-items: center; justify-content: center; min-height: 160px; }
/* 미리보기 이미지는 길게 눌러 저장할 수 있다(http·카톡 안 브라우저에서 공유 창 대신) */
.share-preview img {
  display: block;
  max-width: 100%;
  max-height: min(56vh, 540px);
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(40, 25, 15, .18);
  -webkit-touch-callout: default;
}
.share-wait { margin: 0; color: var(--muted); font-weight: 600; }
.share-who { display: flex; align-items: center; gap: 10px; min-height: var(--tap); margin-top: 10px; font-weight: 600; }
.share-who input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.share-hint { margin: -4px 0 8px; font-size: 13px; color: var(--muted); word-break: keep-all; }
.share-note { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.5; word-break: keep-all; }
#share-go { width: 100%; }
/* 저장 안내 띠: 위쪽 줄 바로 아래 가운데. 손가락 동작은 이 띠에서 시작하면 무시한다 */
.zoom-note {
  position: absolute;
  top: calc(max(6px, env(safe-area-inset-top)) + var(--tap) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 420px);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(30, 27, 25, .92);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
  text-align: center;
}
.zoom-note p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.5; word-break: keep-all; }
.zoom-note .btn { margin-top: 10px; width: 100%; }
.viewer-panel {
  flex: none;
  width: auto;
  max-width: 448px;
  position: relative;
  /* 아래 큰 [이야기 편집] 버튼을 없앴으므로(2026-10-19) 홈 막대 자리는 카드 아래 여백으로 */
  margin: 10px 16px max(20px, env(safe-area-inset-bottom));
  padding: 18px 18px 16px;
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
@media (min-width: 481px) { .viewer-panel { margin: 10px auto max(20px, env(safe-area-inset-bottom)); width: 448px; } }
.viewer-read { margin: 0; }
/* 고칠 수 있으면 카드 전체가 [이야기 편집]과 같은 누르는 곳(app.js) */
.viewer-panel.editable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* 맨 위 작은 한 줄 "앨범 이름 · 날짜": 앨범 이름이 아주 길면 이름만 말줄임, 날짜는 그대로 */
.viewer-read-meta { display: flex; align-items: baseline; min-width: 0; margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.viewer-read-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.viewer-read-meta .dot, .viewer-read-date { flex: none; }
/* 줄이 flex라 가운데 점 양옆 띄어쓰기가 사라지지 않게(공유 이미지처럼 "이름 · 날짜") */
.viewer-read-meta .dot { white-space: pre; }
/* 오른쪽 위 연필(이야기 편집, 누르는 곳 44px): "앨범 이름 · 날짜" 줄은 연필 앞에서 끝나고 긴 이름은 말줄임 */
.viewer-edit-icon { position: absolute; top: 2px; right: 2px; color: var(--muted); }
.viewer-panel.editable .viewer-read-meta { padding-right: 34px; }
/* 제목·이야기는 띄어쓰기에서만 줄바꿈(단어 중간에서 끊지 않음), 한 줄에 안 들어가는 아주 긴 한 단어만 끊는다 */
.viewer-read-title {
  margin: 4px 0 0;
  /* 공유 이미지 제목과 같게 Pretendard 굵게(JW 2026-10-18, 메이플스토리는 로고·앨범 표지 이름에만) */
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.viewer-read-empty { margin: 10px 0 0; color: var(--muted); font-size: 15px; font-weight: 500; }
.viewer-read-story { margin: 10px 0 0; color: var(--text); font-size: 16px; font-weight: 400; line-height: 1.6; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.viewer-read .tag-row { margin: 12px 0 0; }
.viewer-cover-on {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-on-soft);
  font-size: 13px;
  font-weight: 700;
}
.viewer-trashed { margin: 0 0 12px; }

/* 고치기 시트: 아래에서 올라오는 흰 칸 + 뒤는 살짝 어둡게 */
.viewer-sheet {
  position: fixed;
  inset: 0;
  z-index: 52;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(40, 25, 15, .35);
}
.viewer-sheet-box {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 16px max(20px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--card);
  box-shadow: 0 -6px 24px rgba(40, 25, 15, .18);
  animation: sheet-up .2s ease-out;
}
.viewer-sheet-box .panel-head { margin: 0 -8px 8px 0; }
.viewer-sheet-box h2 { margin: 0; font-size: 18px; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .viewer-sheet-box { animation: none; } }
#viewer-trash-ask .viewer-ask-box .btn + .btn { margin-top: 8px; }
#viewer-trash-ask .hint { margin: -6px 0 16px; word-break: keep-all; }

/* ---------- 그림 올리기 시트(디자인 4단계) ---------- */
/* 단계 번호는 보이는 칸만 센다(아이 화면에서 열면 "누구의 그림" 칸이 없어 1. 사진부터) */
.upload-form { counter-reset: up-step; }
.up-step { counter-increment: up-step; margin: 0 0 26px; }
.up-step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.up-step-title { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.up-step-title::before { content: counter(up-step) ". "; color: var(--accent); }
.up-step-title label { display: inline; margin: 0; font-size: inherit; font-weight: inherit; }
.up-count { flex: none; color: var(--muted); font-size: 14px; font-weight: 600; }
/* 아이 이름 단추: 가로로 나열(넘치면 다음 줄), 고른 단추는 주황 바탕·흰 글씨 */
.child-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.child-chip {
  max-width: 100%;
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.child-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.child-chip:disabled { opacity: .6; cursor: default; }
/* 고른 사진 4칸 + 점선 [+] */
.upload-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
/* 끌어다 놓는 동안: 사진 칸에 점선 테두리 + "여기에 놓으세요"(컴퓨터만, 휴대폰에는 끌어다 놓기가 없다) */
.drag-sheet .upload-grid::after {
  content: "여기에 놓으세요";
  position: absolute;
  inset: -6px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-on-soft);
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
}
/* 아이 앨범 화면으로 끌어 오는 동안: 화면 전체 점선 + "여기에 놓으면 (이름) 그림 올리기가 열려요" */
.drop-hint {
  position: fixed;
  inset: 12px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 3px dashed var(--accent);
  border-radius: 24px;
  background: var(--accent-soft);
  color: var(--accent-on-soft);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  word-break: keep-all;
  pointer-events: none;
}
.drop-hint[hidden] { display: none; }
.up-tile { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: #efe6dc; }
.up-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.up-tile.done img { opacity: .55; }
.up-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  max-width: calc(100% - 8px);
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(43, 37, 34, .78);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-tile.fail .up-badge { background: var(--error); }
.up-tile.done .up-badge { background: var(--ok); }
.up-badge.date { background: rgba(255, 255, 255, .92); color: var(--text); }
/* 사진 빼기: 보이는 동그라미는 작게, 누르는 곳은 44px(사진 오른쪽 위 모서리) */
.up-tile-remove {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  background: none;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 4px;
  cursor: pointer;
}
.up-tile-remove .ico { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: rgba(43, 37, 34, .72); color: #fff; stroke-width: 2.5; }
.up-tile-remove:disabled { display: none; }
.up-add {
  aspect-ratio: 1 / 1;
  min-height: var(--tap);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.up-add:disabled { color: var(--muted); cursor: default; }
.up-add-text { display: none; }
/* 아직 안 골랐으면 [+ 사진 고르기]가 한 줄을 다 쓴다 */
.upload-grid.empty .up-add { grid-column: 1 / -1; aspect-ratio: auto; min-height: 96px; flex-direction: row; background: var(--card); }
.upload-grid.empty .up-add-text { display: inline; }
/* 넣지 않은 파일 안내(HEIC·사진이 아닌 파일)와 실패한 사진의 이유 */
.up-note { margin: 10px 0 0; color: var(--error); font-size: 14px; font-weight: 600; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.up-fail-why { list-style: none; margin: 10px 0 0; padding: 0; color: var(--error); font-size: 14px; overflow-wrap: anywhere; }
.up-fail-why li + li { margin-top: 4px; }
.up-dates-btn { display: block; margin-top: 8px; font-size: 14px; }
#upload-list { margin-top: 4px; }
.up-hint { margin: 8px 0 0; }
/* 아래 고정 버튼(시트 안에서 화면 아래에 붙는다) */
.upload-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -16px calc(-1 * max(24px, env(safe-area-inset-bottom)));
  padding: 10px 16px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(255, 249, 243, 0), var(--bg) 14px);
}
.upload-foot .upload-status { margin: 0 0 8px; }
/* 올리는 동안 진행 막대(JW 2026-11-12) + 두 줄 글자("30장 중 12장째 올리는 중" / "11장 올렸어요 · 1장 실패") */
.upload-foot .upload-status { white-space: pre-line; }
.upload-progress { height: 8px; margin: 0 0 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.upload-progress[hidden] { display: none; }
.upload-progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s; }
/* 고른 즉시 보이는 빈 칸: 작은 미리보기를 만드는 동안 "준비 중" */
.up-tile.prep img { visibility: hidden; }
.upload-foot .btn { min-height: 56px; border-radius: 28px; font-size: 17px; }
.upload-foot #upload-why { margin: 6px 0 0; }
.upload-foot #upload-why:empty { display: none; }
/* 내용이 짧아도 올리기 버튼이 화면 아래에 붙게: 시트를 세로로 채운다 */
.sheet { display: flex; flex-direction: column; }
.sheet-top { flex: none; width: 100%; }
.sheet-body { flex: 1 0 auto; display: flex; flex-direction: column; width: 100%; }
.sheet-body > .upload-form { flex: 1 0 auto; display: flex; flex-direction: column; }
.upload-foot { margin-top: auto; }

/* ---------- 홈 화면에 올리기 안내(계정 칸 버튼·첫 안내 카드·방법 시트·앱 안 브라우저 로그인 안내) ---------- */
.btn.ico-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn.ico-btn .ico { color: var(--accent); }
.account-panel .install-btn { margin-bottom: 8px; }
.install-card { display: flex; align-items: center; gap: 10px; padding: 12px 6px 12px 14px; margin-bottom: 12px; }
.install-card-ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-on-soft);
}
.install-card-text { flex: 1; min-width: 0; margin: 0; font-size: 14px; line-height: 1.45; word-break: keep-all; }
.install-card-text strong { display: block; font-size: 15px; }
.install-card-text span { color: var(--muted); font-weight: 500; }
.install-card .btn.small { flex: none; }
.install-card .icon-btn { margin-left: -4px; }
.install-sheet { z-index: 70; }
.install-lead { margin: 0 0 14px; color: var(--muted); font-size: 15px; font-weight: 500; line-height: 1.55; word-break: keep-all; }
.install-steps { list-style: none; margin: 0 0 16px; padding: 0; counter-reset: step; }
.install-steps li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); counter-increment: step; }
.install-steps li:last-child { border-bottom: 1px solid var(--line); }
.install-step-ico {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-on-soft);
}
.install-step-ico::before {
  content: counter(step); position: absolute; top: -6px; left: -6px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.install-step-text { flex: 1; min-width: 0; margin: 2px 0 0; font-size: 16px; font-weight: 700; line-height: 1.45; word-break: keep-all; }
.install-step-text small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 500; }
.inapp-note {
  display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 16px; padding: 10px 12px;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent-on-soft);
}
.inapp-note .ico { margin-top: 1px; }
.inapp-note p { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.5; word-break: keep-all; }
.inapp-note .inapp-how { font-weight: 500; }

/* ---------- 처리방침 v1.2·약관 v1 페이지(docs/policy 확정본을 tests/build-policy.mjs가 옮김) ---------- */
.policy-body hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.policy-body ol.num, .policy-body ul.plain { list-style: none; margin: 0 0 10px; padding-left: 0; }
.policy-body li ol.num, .policy-body li ul.plain, .policy-body li ul.dot { margin: 6px 0 0; padding-left: 18px; }
.policy-body ul.dot { margin: 0 0 10px; padding-left: 20px; }
.policy-body ol.num > li > .n { font-weight: 600; }
.policy-table.wide { min-width: 760px; }
/* 이전 방침(v1.1 보관본) 맨 위 안내 — 본문과 구분되는 작은 상자 */
.policy-old-note { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 10px; background: var(--card); font-size: 14px; font-weight: 600; word-break: keep-all; }
.policy-old-note a { color: var(--accent); white-space: nowrap; }
/* 동의 화면 v1.2: 안내 상자가 체크 위로(체크 하나) */
.consent .consent-summary { margin: 14px 0 4px; padding: 12px 14px; }
.consent-summary p { margin: 0 0 8px; color: var(--muted); font-weight: 500; word-break: keep-all; line-height: 1.55; }
.consent-summary p:last-child { margin-bottom: 0; }
.consent-summary p strong { color: var(--text); font-weight: 700; }
/* 원장 공유 앨범 안내(함께 편집으로 공유받은 앨범) — 앱 안 브라우저 안내와 같은 모양 + 오른쪽 [닫기] */
.edit-note { margin: 0 0 12px; align-items: center; padding-right: 4px; }
.edit-note p { flex: 1; min-width: 0; }
.edit-note .icon-btn { flex: 0 0 auto; color: var(--accent-on-soft); }

/* ---------- PC 넓은 화면 1단계(원장님용 ④-가, JW 결정 2026-11-08, CSS만) ----------
   화면 폭 1024px 이상에서만. 휴대폰은 가로로 돌려도 1024px보다 좁아서 이 규칙이 하나도 적용되지 않는다(휴대폰 화면 그대로).
   가운데 띠를 넓히고, 홈 앨범 카드 2열(1600px 이상 3열), 앨범 그림 격자 한 줄 6장(8장), 촘촘히 10장(12장).
   촘촘히 보기(홈 한 줄 목록)와 순서 바꾸기는 한 줄씩 그대로(↑↓가 위아래 그대로 보이게). 크게 보기·시트·위쪽 띠는 그대로. 앨범 표지는 옆으로 나란히(아래).
   (JW 2026-11-08 캡처 확인) 홈 촘촘히 보기는 한 줄이 너무 길어 이름과 ⋯이 멀어지므로 홈 묶음(앨범 n개 줄·목록·아이 추가·순서 바꾸기·휴지통)을 720px로 가운데.
   [+ 그림 올리기](첫 화면·앨범 모두)는 가운데 카드를 가리지 않게 오른쪽 아래(펼친 모양·동그란 모양 모두). 휴대폰은 가운데 그대로 */
@media (min-width: 1024px) {
  .wrap { max-width: 1120px; padding-left: 32px; padding-right: 32px; }
  .home-section:has(> #child-list.compact) { max-width: 720px; margin-left: auto; margin-right: auto; }
  .fab, .fab.mini { left: auto; right: max(24px, env(safe-area-inset-right)); transform: none; }
  .kid-list:not(.compact) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
  body.reordering .kid-list { display: block; }
  .art-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  #gallery-months.dense .art-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
  /* 앨범 표지(JW 2026-11-08): 긴 띠 대신 "옆으로 나란히" — 왼쪽 정사각형 표지 칸(그림은 자르지 않고 통째로, 남는 곳은 촘촘히 칸과 같은 옅은 바탕),
     오른쪽 이름·그림 수. 오른쪽 아래(more)는 나중 대표작 자리. 표지를 누르면 크게 보기는 그대로(누르는 곳은 표지 칸) */
  .album-cover, .album-cover.c1, .album-cover.c2, .album-cover.c3 {
    display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto 1fr;
    grid-template-areas: "pic text" "pic more"; column-gap: 28px; height: auto; min-height: 220px; background: var(--card);
  }
  .album-cover::after { display: none; }
  .album-cover-img { position: relative; inset: auto; grid-area: pic; width: 220px; height: 220px; background: #fbf4ec; }
  .album-cover:not(.has-img) .album-cover-img { background: #fdebdd; }
  .album-cover.c1:not(.has-img) .album-cover-img { background: #e6f0e4; }
  .album-cover.c2:not(.has-img) .album-cover-img { background: #e3edf6; }
  .album-cover.c3:not(.has-img) .album-cover-img { background: #fbe4ec; }
  .album-cover-img img { object-fit: contain; object-position: 50% 50%; }
  .album-cover-btn { inset: 0 auto auto 0; width: 220px; height: 220px; border-radius: 24px 0 0 24px; }
  .album-cover-text { position: static; grid-area: text; flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 30px 24px 0 0; color: var(--text); text-shadow: none; }
  .album-cover-text #gallery-name { flex: none; width: 100%; font-size: 32px; }
  .album-cover-text .gallery-sub { padding: 0; color: var(--muted); font-size: 16px; font-weight: 600; }
  .album-cover-more { grid-area: more; }
}
@media (min-width: 1600px) {
  .wrap { max-width: 1520px; }
  .kid-list:not(.compact) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .art-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  #gallery-months.dense .art-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}
