/* 초대 */
.invite-banner {
  background: var(--accent-soft); color: var(--text); border-radius: var(--radius); padding: 12px 14px;
  margin: 16px 0 0; font-size: 14px; line-height: 1.5;
}
.invite-banner small { color: var(--muted); }
.invite-banner.error { background: #fdf0e8; color: var(--danger); margin: 0 0 12px; }
.auth .invite-banner.error { margin-top: 16px; }
.link-box {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  font-size: 14px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace;
}

:root {
  --accent: #0f766e;
  --accent-soft: #e6f4f1;
  --bg: #f6f7f5;
  --card: #ffffff;
  --text: #1c2321;
  --muted: #6b7672;
  --line: #e3e7e4;
  --danger: #c2410c;
  --radius: 14px;      /* 버튼·입력칸·카드·팝업 */
  --radius-sm: 10px;   /* 작은 버튼·사진 썸네일 */
  --radius-chip: 999px;/* 칩·탭 모양 선택 */
  --radius-sheet: 24px;/* 아래에서 올라오는 창 */
  --tabbar-h: 60px;
  --safe-b: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)); /* 앱(Capacitor 안드로이드)은 --safe-area-inset-* 를 넣어 줘요 */
  --safe-t: var(--safe-area-inset-top, env(safe-area-inset-top, 0px)); /* 앱(Capacitor 안드로이드)은 --safe-area-inset-* 를 넣어 줘요 */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45;
  overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
h2 { font-size: 20px; margin: 0 0 12px; }

/* 공통 입력 */
.field { display: block; margin-bottom: 14px; }
.field > span { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field textarea { resize: vertical; min-height: 84px; line-height: 1.5; font: inherit; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); font-size: 16px; /* iOS 확대 방지 */
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.hint { color: var(--muted); font-size: 12px; display: block; margin-top: 6px; }
/* minmax(0,1fr): 칸 안 내용(특히 폰의 날짜 입력칸)이 넓어도 화면 폭에 맞춰 줄어들게 */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.grid2 > * { min-width: 0; }
@media (max-width: 340px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
/* 날짜·시간 입력칸: 아이폰은 기본 모양이 넓어서 화면 밖으로 나가므로 칸 너비에 맞춤 */
.field input[type="date"], .field input[type="time"], .bulk-plan input[type="time"] {
  display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 48px;
  -webkit-appearance: none; appearance: none; text-align: left;
}
.field input[type="date"]::-webkit-date-and-time-value, .field input[type="time"]::-webkit-date-and-time-value,
.bulk-plan input[type="time"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="time"]::-webkit-calendar-picker-indicator { margin-left: 2px; }
/* 한 손가락으로 끌어도 화면·창이 옆으로 밀리지 않게 (사진 줄·날짜 칩처럼 가로로 넘기는 곳은 그대로) */
html, body { overflow-x: hidden; }
.scroll, .sheet-body { overflow-x: hidden; }
.field, .grid2, form { min-width: 0; max-width: 100%; }
.primary {
  width: 100%; padding: 14px; border: 0; border-radius: var(--radius); background: var(--accent); color: #fff;
  font-weight: 700; font-size: 16px;
}
.primary:disabled { opacity: .6; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 8px 0; font-size: 14px; }
.chip-btn { border: 0; background: var(--accent-soft); color: var(--accent); padding: 8px 12px; border-radius: var(--radius-chip); font-weight: 700; font-size: 14px; }

/* 로그인 */
.auth { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.brand { font-size: 28px; font-weight: 800; }
.seg { display: flex; background: #e9ecea; border-radius: var(--radius); padding: 4px; margin: 20px 0; }
.seg button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 레이아웃 */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; gap: 10px; align-items: center; padding: calc(10px + var(--safe-t)) 16px 10px;
  background: var(--card); border-bottom: 1px solid var(--line); z-index: 500;
}
.topbar select {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg); font-weight: 700; font-size: 16px;
}
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: #fff;
  font-weight: 800; font-size: 16px;
}
main { flex: 1; position: relative; overflow: hidden; }
.view { position: absolute; inset: 0; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad { padding: 16px 16px calc(100px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
#map { position: absolute; inset: 0; background: #dfe7e4; }

.tabbar {
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b); z-index: 500;
}
.tabbar button {
  flex: 1; height: var(--tabbar-h); border: 0; background: none; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); font-weight: 600;
}
.tabbar button span { font-size: 20px; filter: grayscale(1); opacity: .6; }
.tabbar button.on { color: var(--accent); }
.tabbar button.on span { filter: none; opacity: 1; }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 600;
  width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--accent); color: #fff;
  font-size: 30px; line-height: 1; box-shadow: 0 6px 18px rgba(15,118,110,.4);
}

/* 지도 핀 */
.pin-wrap { background: none; border: 0; }
.pin {
  width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center;
  font-size: 20px; overflow: hidden; position: relative;
}
.pin img { width: 100%; height: 100%; object-fit: cover; }
.pin-wrap::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: #fff; border-bottom: 0;
}
.pin-num {
  position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
  min-width: 20px; height: 20px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; z-index: 1;
}
.map-empty {
  position: absolute; left: 16px; right: 16px; top: 16px; z-index: 450; background: var(--card); padding: 14px 16px;
  border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.1); font-size: 14px;
}

/* 타임라인 */
.tl-date { font-size: 14px; color: var(--muted); margin: 20px 0 8px; font-weight: 700; }
.tl-date:first-child { margin-top: 0; }
.card {
  display: flex; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; margin-bottom: 10px;
}
.card .thumb {
  width: 76px; height: 76px; flex: none; border-radius: var(--radius-sm); background: var(--accent-soft); object-fit: cover;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.card .body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.card b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .comment { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card small { color: var(--muted); font-size: 12px; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 44px; }

/* 여행 */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.stats { display: flex; gap: 8px; margin-bottom: 14px; }
.stats div { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; }
.stats b { display: block; font-size: 20px; color: var(--accent); }
.stats small { color: var(--muted); font-size: 12px; }
.trip-card .thumb { width: 64px; height: 64px; }

/* 바텀 시트 */
.sheet { position: fixed; inset: 0; z-index: 1000; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .2s; }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; background: var(--bg);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; padding: 8px 16px calc(20px + var(--safe-b)); transform: translateY(100%);
  transition: transform .22s ease-out; max-width: 640px; margin: 0 auto;
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-body { transform: none; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: #cfd5d2; margin: 4px auto 14px; }
.sheet-close {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  border: 0; background: rgba(233,236,234,.95); width: 32px; height: 32px; border-radius: 50%; font-size: 16px;
}
.sheet-body > h2 { margin-right: 40px; }
.sheet-body > .gallery { margin-top: 30px; }

/* 기록 추가 */
.photo-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.photo-strip .ph { position: relative; flex: none; }
.photo-strip img, .add-photo {
  width: 84px; height: 84px; border-radius: var(--radius); object-fit: cover; display: block; flex: none;
}
.add-photo {
  display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed #c6cecb;
  color: var(--muted); font-size: 26px; background: var(--card);
}
.add-photo small { font-size: 11px; }
.ph .size { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 6px; }
.ph .x, .g-del {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.6); color: #fff; font-size: 12px; line-height: 24px; padding: 0;
}
.ph.loading { width: 84px; height: 84px; border-radius: var(--radius); background: #e9ecea; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }
.search-row button { flex: none; border: 0; border-radius: var(--radius); padding: 0 16px; background: var(--text); color: #fff; font-weight: 700; }
.results button {
  display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 6px;
}
.results small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-map { height: 220px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #dfe7e4; }
.cats { display: flex; flex-wrap: wrap; gap: 6px; }
.cats label input { display: none; }
.cats label span {
  display: inline-block; padding: 8px 12px; border-radius: var(--radius-chip); background: var(--card); border: 1px solid var(--line);
  font-size: 14px;
}
.cats label input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }

/* 장소 상세 */
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px 14px; padding: 0 16px; }
.g-item { position: relative; flex: none; width: 82%; scroll-snap-align: center; }
.g-item:only-child { width: 100%; }
.g-item img { width: 100%; height: 260px; object-fit: cover; border-radius: 14px; display: block; background: #e9ecea; }
.pd-cat { display: inline-block; font-size: 13px; background: var(--accent-soft); color: var(--accent); padding: 3px 10px; border-radius: var(--radius-chip); font-weight: 700; }
.pd-name { font-size: 22px; margin: 8px 0 6px; }
.pd-comment { font-size: 17px; margin: 0 0 12px; padding: 12px 14px; background: var(--card); border-radius: var(--radius); border-left: 4px solid var(--accent); }
.pd-meta { color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 3px; }

.member { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.member .avatar { width: 32px; height: 32px; font-size: 13px; }
.member .grow { flex: 1; }
.member small { color: var(--muted); }
.member button { border: 0; background: none; color: var(--danger); font-size: 13px; font-weight: 600; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

.lightbox { position: fixed; inset: 0; z-index: 2000; background: #000; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 90px); transform: translate(-50%, 20px);
  background: rgba(28,35,33,.92); color: #fff; padding: 10px 16px; border-radius: var(--radius-chip); font-size: 14px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 3000; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.leaflet-control-attribution { font-size: 10px; }

/* 이야기(긴 메모) */
.pd-memo {
  white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.65;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* 친구 한마디 */
.cm-title { margin: 0 0 10px; font-size: 16px; }
.cm-title small { color: var(--accent); margin-left: 4px; }
.comments { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.cm { display: flex; gap: 10px; }
.cm .avatar { width: 32px; height: 32px; font-size: 13px; flex: none; }
.cm-body { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 8px 12px; }
.cm-head { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.cm-head small { color: var(--muted); font-size: 12px; }
.cm-del { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 12px; padding: 0; }
.cm-text { white-space: pre-wrap; word-break: break-word; font-size: 15px; margin-top: 2px; }
.cm-form { display: flex; gap: 8px; }
.cm-form input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 16px; background: var(--card); }
.cm-form button { flex: none; border: 0; border-radius: var(--radius); padding: 0 16px; background: var(--accent); color: #fff; font-weight: 700; }
.cm-form button:disabled { opacity: .6; }
.empty small { font-size: 13px; }

/* + 버튼 선택 */
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; gap: 14px; align-items: center; text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.choice .ic { font-size: 28px; flex: none; }
.choice b { display: block; font-size: 16px; }
.choice small { color: var(--muted); font-size: 13px; }

/* 사진으로 한꺼번에 기록 */
.pick-btn { display: block; text-align: center; margin-top: 4px; }
.bulk-status { margin: 12px 0; padding: 12px 14px; background: var(--accent-soft); border-radius: var(--radius); font-size: 14px; line-height: 1.55; }
.bulk-summary { margin: 14px 0 8px; font-size: 15px; }
.bulk-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 10px 0; }
.bulk-card.off { opacity: .45; }
.bulk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.bulk-check { display: flex; align-items: center; gap: 6px; flex: none; }
.bulk-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.bulk-check .num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.bulk-name { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 16px; font-weight: 700; background: var(--bg); }
.bulk-meta { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
.bulk-card .grid2 { margin-top: 8px; }
.bulk-card select, .bulk-card .grid2 input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 15px; background: var(--card); }
.bulk-ph { flex: none; border: 0; padding: 0; background: none; border-radius: var(--radius-sm); position: relative; }
.bulk-ph img { width: 72px; height: 72px; border-radius: var(--radius-sm); object-fit: cover; display: block; }
.bulk-ph.off img { opacity: .3; filter: grayscale(1); }
.bulk-ph.off::after { content: '빼기'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--danger); }
#bulkSave { margin-top: 8px; }
.pin.small { width: 30px; height: 30px; font-size: 13px; font-weight: 800; color: #fff; background: var(--accent); border-width: 2px; }

/* 근처 후보 (카카오) */
.cands { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 2px; }
.cands-label { font-size: 12px; color: var(--muted); font-weight: 700; margin-right: 2px; }
.cand {
  border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius-chip); padding: 5px 10px;
  font-size: 13px; line-height: 1.3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cand small { color: var(--muted); margin-left: 4px; font-size: 11px; }
.cand.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.cand.on small { color: rgba(255,255,255,.8); }

/* 화면 테마 고르기 */
.theme-list { display: flex; flex-direction: column; gap: 8px; }
.theme-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
}
.theme-opt.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.theme-opt .swatch { display: grid; grid-template-columns: 1fr 1fr; width: 40px; height: 40px; flex: none; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid rgba(0,0,0,.12); }
.theme-opt .swatch i { display: block; }
.theme-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.theme-txt b { font-size: 15px; }
.theme-txt small { color: var(--muted); font-size: 12px; }
.theme-check { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: transparent; }
.theme-opt.on .theme-check { background: var(--accent); }

/* 공통 보정: 작은 프로필 동그라미 글자 가운데, 사진 넘기기 스크롤 막대 숨기기 */
.avatar { display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1; }
.cm .avatar, .member .avatar { display: flex; font-size: 14px; }
.gallery { scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }

/* 테마별 아이콘: 기본은 이모지(.emo), 글래스 테마는 그림(.gi) — theme-glass.css 에서 바꿈 */
.gi { display: none; }
.emo { font-style: normal; }

/* 날짜 고르기 (기록장 만들기·수정) */
.rc-pills { display: flex; align-items: stretch; gap: 8px; }
.rc-pill {
  flex: 1; min-width: 0; min-height: 56px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  text-align: left; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
}
.rc-pill small { font-size: 12px; color: var(--muted); font-weight: 600; }
.rc-pill b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-pill.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rc-arrow { align-self: center; color: var(--muted); }
.rc-cal { margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 4px; }
.rc-head { display: flex; align-items: center; justify-content: space-between; }
.rc-nav { width: 44px; height: 44px; border: 0; background: none; font-size: 24px; color: var(--muted); border-radius: var(--radius-sm); }
.rc-hint { margin: 0 0 6px; text-align: center; font-size: 13px; color: var(--accent); font-weight: 600; }
.rc-week, .rc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.rc-week span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.rc-week span:first-child { color: #c2410c; }
.rc-day { height: 44px; border: 0; background: none; border-radius: var(--radius-sm); font-size: 15px; color: var(--text); position: relative; }
.rc-day:disabled { color: #c9c6d1; cursor: not-allowed; }
.rc-day.today { box-shadow: 0 0 0 1px var(--line) inset; }
.rc-day.mid { background: var(--accent-soft); border-radius: 0; }
.rc-day.start, .rc-day.end { background: var(--accent); color: #fff; font-weight: 700; }
.rc-day.ranged.start { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.rc-day.ranged.end { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.rc-foot { display: flex; justify-content: space-between; }
.rc-foot .link { min-height: 44px; }

/* ===== Phase 3: 기록 제목·감정·태그·즐겨찾기·검색 ===== */
.card-sub { display: block; font-size: 12px; }
.fav-on { color: #f2a900; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0; }
.tag { font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft, #ece8f7); padding: 1px 7px; border-radius: 999px; }
.mood-chip { font-size: 12px; font-weight: 700; background: #fff4d6; color: #7a5a00; padding: 2px 8px; border-radius: 999px; }
.pd-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fav-btn { border: 1px solid var(--line); background: var(--card); color: #b9b4c7; font-size: 22px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }
.fav-btn.on { color: #f2a900; border-color: #f2c94c; background: #fff8e1; }
.pd-place { margin: -4px 0 6px; font-size: 14px; }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.small-note { font-size: 13px; align-self: center; }
.jr-bar { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 4px 0 8px; margin-bottom: 4px; }
.jr-bar input[type=search] { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px; background: var(--card); }
.jr-chips { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; scrollbar-width: none; }
.jr-chips:empty { display: none; }
.jr-chip { flex: none; border: 1px solid var(--line); background: var(--card); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap; }
.jr-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.jr-count { font-size: 13px; margin: 4px 0 8px; }
.chk-line { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-top: 8px; }
.chk-line input { width: 18px; height: 18px; accent-color: var(--accent); }
.diary-ai { margin: -6px 0 14px; }
.diary-preview { margin-top: 8px; padding: 12px; border: 1px dashed var(--accent); border-radius: var(--radius); background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.diary-preview p { margin: 0; white-space: pre-wrap; line-height: 1.6; }
.diary-preview .mini-seg { margin: 0; }

/* ===== Phase 4: 멤버 역할 · 보기 전용 ===== */
.role-chip { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: #eceff0; color: #4b5563; margin-left: 4px; }
.role-chip.owner { background: #fff4d6; color: #7a5a00; }
.role-chip.editor { background: var(--accent-soft, #ece8f7); color: var(--accent); }
.role-sel { padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 13px; max-width: 120px; }
.search-row .role-sel { flex: none; }
.ro-banner { font-size: 13.5px; }
/* 보기 전용 여행: 추가·수정 버튼 숨김 (서버에서도 막혀 있어요) */
body.read-only #fab, body.no-edit-trips #fab,
body.read-only .plan-actions, body.read-only .pi-tools, body.read-only [data-act="add-expense"], body.read-only [data-exp],
body.read-only #ckForm, body.read-only [data-ckdel], body.read-only [data-act="ck-defaults"],
body.read-only [data-act="new-page"], body.read-only .sb-edit-btn, body.read-only [data-pmenu],
body.read-only [data-act="new-book"], body.read-only [data-act="book-menu"], body.read-only [data-st="edit"],
body.read-only [data-act="ai-helper"], body.read-only [data-act="add-item"], body.read-only [data-act="edit-trip"] { display: none !important; }
body.read-only .ck-list input { pointer-events: none; opacity: .6; }
body.read-only [data-m="edit"], body.read-only [data-m="import"] { display: none !important; }

/* ===== 브랜드: 모아로그 로고 (로그인 화면) ===== */
.brand-logo { margin: 0 0 4px; line-height: 0; }
.brand-logo img { width: min(260px, 80%); height: auto; }

/* ===== 기록장의 남은 일정 (흐린 카드) ===== */
.card.plan-card { border-style: dashed; border-color: var(--accent); background: transparent; opacity: .82; align-items: center; cursor: pointer; }
.card.plan-card .thumb { background: var(--accent-soft, #ece8f7); display: flex; align-items: center; justify-content: center; }
.tl-time.plan { color: var(--accent); }
.plan-go { flex: none; border: 1px solid var(--accent); background: var(--card); color: var(--accent); font-weight: 800; font-size: 13px; padding: 8px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }

/* ===== 여행 바로가기 (타임라인 · 기록장 · 스크랩북) ===== */
.trip-card { flex-wrap: wrap; }
.trip-go { flex-basis: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.trip-go button { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; color: var(--text); }
.trip-go button b { font-size: 13.5px; white-space: nowrap; }
.trip-go button small { font-size: 11.5px; color: var(--muted); }
.trip-go button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.trip-go button.on small { color: rgba(255,255,255,.85); }
.trip-card.hub { display: block; }
.hub-top { display: flex; gap: 12px; align-items: center; }
.hub-top .body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pick-intro { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; margin: -4px 0 14px; color: var(--text); }
.pick-intro small { color: var(--muted); }

/* ===== UI/UX 개선 제안서 반영 ===== */
/* 화면 아래 내용이 하단 탭·+ 버튼에 가리지 않게 */
.pad { padding-bottom: calc(132px + var(--safe-b)); }
/* + 버튼 이름표 (탭마다 바뀜) */
.fab { overflow: visible; }
.fab-label { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); white-space: nowrap;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; padding: 7px 12px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); pointer-events: none; font-style: normal; line-height: 1.2; }
.small-cta { width: auto; display: inline-block; margin-top: 14px; padding: 12px 22px; border-radius: 999px; }
/* 기록장: 사진 중심 피드 */
.card.feed-card { display: block; padding: 0; overflow: hidden; }
.feed-photo { position: relative; aspect-ratio: 16 / 10; background: var(--line); }
.feed-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-n { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.feed-fav { position: absolute; left: 10px; top: 10px; background: rgba(255,255,255,.92); color: #f2a900; font-size: 16px; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.feed-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.feed-meta { font-size: 12.5px; color: var(--muted); }
.feed-title { font-size: 16.5px; }
.feed-memo { font-size: 13.5px; color: var(--text); opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
/* 예정 일정은 기록과 따로 */
.jr-plans { border: 1.5px dashed var(--accent); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; background: var(--accent-soft, #f3f0fb); }
.jr-plans h3 { margin: 0 0 10px; font-size: 14.5px; color: var(--accent); }
.jr-plans .card.plan-card { background: var(--card); opacity: 1; margin-bottom: 8px; }
.jr-chip.plan { border-style: dashed; }

/* ===== 여러 개 고르기 · 한꺼번에 삭제 ===== */
.bulk-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h, 64px) + var(--safe-b, 0px) + 12px); z-index: 650;
  width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 28px rgba(47,42,74,.22); }
.bulk-bar b { flex: 1; text-align: center; font-size: 14px; }
.bulk-bar button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 12px; font-size: 13.5px; font-weight: 700; color: var(--text); cursor: pointer; white-space: nowrap; }
.bulk-bar .bulk-del { background: var(--danger, #d64545); border-color: var(--danger, #d64545); color: #fff; }
.bulk-bar .bulk-del:disabled { opacity: .4; }
body.selecting #fab { display: none !important; }
.sel-box { position: absolute; top: 10px; left: 10px; z-index: 3; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--accent); background: rgba(255,255,255,.95); }
.sel-box.on { background: var(--accent); }
.sel-box.on::after { content: '✓'; color: #fff; font-weight: 900; font-size: 16px; display: flex; align-items: center; justify-content: center; height: 100%; }
.plan-item.pickable, .plan-item.picked, .card.pickable, .card.picked, .sb-page-card.pickable, .sb-page-card.picked { position: relative; cursor: pointer; }
.plan-item.pickable, .plan-item.picked { padding-left: 46px; }
.plan-item.picked, .card.picked, .sb-page-card.picked { outline: 2.5px solid var(--accent); outline-offset: -1px; }
.card.feed-card.locked { opacity: .45; }

/* 아이폰 가로 화면에서 글자가 저절로 커지지 않게 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* AI 기능 첫 사용 동의 창 (아래에서 올라온 창 위에 떠요) */
.consent-wrap { position: fixed; inset: 0; z-index: 3000; background: rgba(20, 16, 32, .45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.consent-box { background: var(--card); border-radius: var(--radius); max-width: 420px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.25); font-size: 14.5px; line-height: 1.55; }
.consent-box h2 { margin: 0 0 8px; font-size: 19px; }
.consent-box ul { padding-left: 20px; margin: 8px 0; }
.consent-box .btn-row { justify-content: flex-end; }
.consent-box .primary { width: auto; padding: 12px 18px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 4px; font-size: 13px; }
.legal-links a, .legal-links .link { color: var(--muted); text-decoration: underline; font-size: 13px; padding: 6px 0; font-weight: 500; }
/* 여행 날짜 바꾸기: 기간 밖 일정 처리 창 */
.date-move-hint { display: block; margin-top: 6px; }
.out-box .choice-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.out-box .choice-line input { margin-top: 4px; }
.out-box .choice-line span { display: flex; flex-direction: column; }
.out-box .choice-line small { color: var(--muted); font-size: 12.5px; }
.out-moves { padding: 4px 0 8px 26px; display: flex; flex-direction: column; gap: 8px; }
.out-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.out-row > div { display: flex; flex-direction: column; min-width: 0; }
.out-row small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.out-row select { padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); font-size: 14px; }
/* 신고·차단 (App Store 지침 1.2) */
.ugc-actions { display: flex; gap: 16px; margin: 6px 0 0; }
.ugc-actions .link { color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 0; }
.report-box .report-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin: 8px 0; }
.report-box textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; font: inherit; font-size: 14px; margin-bottom: 6px; }
.block-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
