/* ── AI 여행계획 시트 (입력 · 미리보기) ── */
#ai-sheet-wrap .ai-backdrop, #np-sheet-wrap .ai-backdrop, #pe-sheet-wrap .ai-backdrop { position: fixed; inset: 0; z-index: 449; background: rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
#ai-sheet-wrap.open .ai-backdrop, #np-sheet-wrap.open .ai-backdrop, #pe-sheet-wrap.open .ai-backdrop { opacity: 1; pointer-events: auto; }
.ai-sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 450; width: 100%; max-width: 430px; max-height: 92dvh; max-height: 92vh;
  display: flex; flex-direction: column; border-radius: 24px 24px 0 0; background: var(--bg2); border: 1px solid var(--border2); border-bottom: none;
  transform: translate(-50%, 105%); visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0.3s;
}
#ai-sheet-wrap.open .ai-sheet, #np-sheet-wrap.open .ai-sheet, #pe-sheet-wrap.open .ai-sheet { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; box-shadow: 0 -12px 40px rgba(60, 20, 120, 0.25); }
.ai-handle { width: 38px; height: 4px; border-radius: 4px; background: var(--border2); margin: 8px auto 4px; flex: none; }
.ai-body { display: flex; flex-direction: column; min-height: 0; flex: 1; padding-bottom: var(--safe-b); }
.ai-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 18px 10px; flex: none; }
.ai-title { font-size: 17px; font-weight: 800; color: var(--text); }
.ai-sub { margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--text3); line-height: 1.4; }
.ai-x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--surface); color: var(--text2); font-size: 15px; cursor: pointer; }
.ai-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 12px; -webkit-overflow-scrolling: touch; }
.ai-foot { display: flex; gap: 8px; padding: 10px 18px 14px; flex: none; border-top: 1px solid var(--border); background: var(--bg2); }
.ai-btn { flex: 1; padding: 13px 10px; border-radius: 14px; border: none; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.ai-btn--ghost { flex: 0 0 38%; background: var(--surface); color: var(--text2); font-size: 12px; }
.ai-btn--main { color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899); box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35); }
.ai-btn:disabled { opacity: 0.4; box-shadow: none; cursor: default; }
.ai-note { margin: 8px 2px 0; font-size: 11px; font-weight: 600; color: var(--text3); line-height: 1.5; }
.ai-mock { font-style: normal; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; color: #b45309; background: rgba(245, 158, 11, 0.16); }
.ai-day { margin-bottom: 12px; }
.ai-day-head { position: sticky; top: 0; z-index: 1; padding: 6px 2px; font-size: 12px; font-weight: 800; color: var(--accent2); background: var(--bg2); }
.ai-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 6px; }
.ai-time { flex: none; width: 50px; padding-top: 11px; font-size: 10px; font-weight: 700; color: var(--text3); text-align: right; }
.ai-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 13px; border: 1px solid var(--border2); background: var(--surface); font-size: 13px; color: var(--text); }
.ai-emoji { flex: none; font-size: 16px; }
.ai-txt { flex: 1; min-width: 0; line-height: 1.35; word-break: break-word; }
.ai-amt { flex: none; font-size: 11px; font-weight: 800; color: var(--text2); white-space: nowrap; }
/* 생성 중 안내 */
.ai-busy { z-index: 4000; }
.ai-busy-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 28px; border-radius: 20px; background: var(--bg2); color: var(--text); text-align: center; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); }
.ai-busy-box .sh-spinner { border-color: color-mix(in srgb, var(--accent2) 25%, transparent); border-top-color: var(--accent2); }
.ai-busy-box b { font-size: 14px; }
.ai-busy-box span { font-size: 12px; font-weight: 600; color: var(--text3); }
.ai-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.tl-ai-btn.is-locked { opacity: 0.55; position: relative; }
.tl-ai-btn.is-locked::after { content: 'PRO'; position: absolute; top: -6px; right: -4px; padding: 1px 5px; border-radius: 999px; font-size: 8px; font-weight: 800; letter-spacing: 0.04em; color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.rc-map--locked { width: 100%; font: inherit; cursor: pointer; background: transparent; }
.rc-map--locked small { font-size: 11px; font-weight: 600; color: var(--text3); }

/* AI 계획: 작성 완료 표시 */
.ai-check {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.45); animation: ai-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ai-pop { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ai-check { animation: none; } }

.nt-ai.is-locked { opacity: 0.55; }
.nt-ai:disabled { opacity: 0.4; }

/* 신규 계획 입력창 */
.np-scroll { padding-bottom: 8px; }
/* iOS 날짜 칸은 고유 최소 폭이 있어 flex 한 줄에서 서로 겹친다. 여행 정보 수정의 .ts-date-row 와 같이 칸 폭을 고정한다 */
.np-dates { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.np-dates .comm-form-input { min-width: 0; width: 100%; }
.np-dates input[type="date"].comm-form-input {
  box-sizing: border-box; max-width: 100%;
  -webkit-appearance: none; appearance: none;
  padding: 12px 6px; text-align: center;
}
.np-dates input[type="date"]::-webkit-date-and-time-value { text-align: center; min-width: 0; }
.np-tilde { color: var(--text3); font-weight: 700; }
.np-len { margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--accent2); }
.np-opt { margin-left: 4px; font-size: 10px; font-weight: 700; color: var(--text3); }
.np-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.np-two > div { min-width: 0; }
.np-party { display: flex; align-items: center; gap: 14px; }
.np-party-num { min-width: 28px; text-align: center; font-size: 18px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.np-budget { display: flex; align-items: center; gap: 8px; }
.np-budget .comm-form-input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.np-cur { flex: none; min-width: 40px; text-align: center; font-size: 13px; font-weight: 800; color: var(--text2); }
.np-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.np-chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border2); background: var(--surface); color: var(--text2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.np-chip.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.np-brand { width: 100%; margin-bottom: 8px; }
/* 계획 상세 개요: 목표 · 형태 · 예산 */
.np-info { margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border2); background: var(--surface); display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text); }
.np-info-type { align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; background: var(--accent2); }
.np-info-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; line-height: 1.5; }
.np-info-k { font-size: 11px; font-weight: 800; color: var(--text3); }
.np-info-sub { font-size: 12px; color: var(--text2); }
.np-info-sub em { font-style: normal; font-weight: 800; }
.np-info-sub em.is-over { color: #e03131; }

/* 계획 상세: 기간·일차 편집 */
.pe-period { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 10px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border2); background: var(--surface); font-size: 13px; color: var(--text); }
.pe-period-k { font-size: 11px; font-weight: 800; color: var(--text3); }
.pe-period b { font-variant-numeric: tabular-nums; }
.pe-period-len { font-size: 12px; font-weight: 700; color: var(--accent2); }
.pe-btn { margin-left: auto; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border2); background: var(--bg2); color: var(--text2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.pe-day-actions { display: flex; gap: 6px; margin: 2px 0 8px; }
.pe-day-actions .pe-btn { margin-left: 0; }
.pe-btn--del { color: #e03131; border-color: color-mix(in srgb, #e03131 40%, var(--border2)); }

/* 설정: 알림 종류 선택 */
.push-prefs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 6px; align-items: center; padding-top: 2px; }
.push-prefs[hidden] { display: none; }
.push-pref { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12.5px; font-weight: 700; color: var(--text2); cursor: pointer; }
.push-pref input { flex: none; width: 17px; height: 17px; accent-color: #8b5cf6; }

/* 여행 형태 버블: 상세 화면 위쪽 제목 줄 오른쪽 끝에 떠 있다. 자리를 차지하지 않아 아래 내용의 정렬에 영향이 없다 */
.trip-type-bubble { position: absolute; top: -2px; right: 0; z-index: 2; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1.4; color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899); box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25); opacity: 0.72; pointer-events: none; }
.trip-type-bubble[hidden] { display: none; }

/* AI 준비물 선택 */
.ai-pack { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-pack-item { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1.5px dashed color-mix(in srgb, var(--accent2) 55%, var(--border2)); background: var(--accent-bg); color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer; }
.ai-pack-item:not(.on) { opacity: 0.5; }
.ai-pack-item input { width: 15px; height: 15px; accent-color: #8b5cf6; margin: 0; }

/* 예산: 현지·자국 통화 선택과 환산 표시 */
.np-budget-cur { margin-top: 8px; }
.np-budget-cur[hidden] { display: none; }
.np-conv { margin-top: 6px; min-height: 16px; font-size: 12px; font-weight: 700; color: var(--accent2); font-variant-numeric: tabular-nums; }
.np-alt { font-size: 12px; font-weight: 700; color: var(--text3); }
.np-info-sub em.is-over, .np-info-row .is-over { color: #e03131; }

/* 신규 계획: 도시 선택 버튼 · 시트 위에 뜨는 선택 창 */
.np-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; cursor: pointer; }
.np-pick span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-pick.is-empty span { color: var(--text3); }
#modal-overlay.is-over-sheet { z-index: 480; }

.pm-card--empty { padding-bottom: 6px; }

/* 함께 편집 */
.cb-card { margin: 0 0 10px; padding: 12px 14px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--accent2) 50%, var(--border2)); background: var(--accent-bg); }
.cb-card.is-on { border-style: solid; }
.cb-card-t { font-size: 13px; font-weight: 800; color: var(--text); }
.cb-card-t small { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--accent2); }
.cb-card p { margin: 4px 0 8px; font-size: 12px; font-weight: 600; line-height: 1.5; color: var(--text2); }
.cb-card .pe-btn { margin-top: 6px; }
.cb-sec { margin-bottom: 14px; }
.cb-sec-t { margin-bottom: 6px; font-size: 12px; font-weight: 800; color: var(--text3); }
.cb-mem { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cb-mem small { display: block; font-size: 11px; font-weight: 600; color: var(--text3); word-break: break-all; }
.cb-tag { margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; background: var(--accent2); }
.cb-tag--you { background: var(--text3); }
.cb-link { padding: 8px 10px; border-radius: 10px; background: var(--surface); font-size: 11.5px; font-weight: 600; word-break: break-all; color: var(--text2); }
.cb-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cb-h-row { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--text); }
.cb-h-row small { display: block; font-size: 11px; color: var(--text3); }
.cb-conf { margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border2); background: var(--surface); }
.cb-conf-h { font-size: 12.5px; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.cb-conf-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: 12.5px; color: var(--text2); }
.cb-conf-row b { color: var(--text); text-align: right; word-break: break-word; }
.cb-conf-acts { display: flex; gap: 8px; margin-top: 8px; }
.cb-conf-acts .sh-btn { flex: 1; }

/* 함께 편집: 항공·숙박 '나만 보기' */
.personal-row { display: flex; align-items: flex-start; gap: 8px; grid-column: 1 / -1; margin-top: 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border2); background: var(--surface); cursor: pointer; }
.personal-row[hidden] { display: none; }
.personal-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: #8b5cf6; }
.personal-row b { font-size: 13px; color: var(--text); }
.personal-row small { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; line-height: 1.45; color: var(--text3); }
.tl-badge-personal { margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; color: var(--accent2); background: var(--accent-bg); }

/* 계획 화면 제목 옆 [AI 여행 계획] 버튼 */
.hdr-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-top-btn {
  padding: 4px 11px; border-radius: 999px; border: none; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 800; white-space: nowrap;
  color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899); text-shadow: 0 1px 2px rgba(76, 29, 149, 0.45); box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}
.ai-top-btn:active { transform: scale(0.95); }

/* 상단 [AI 여행 계획] 선택 시트: 랜덤 / 직접 정하기 */
.aitop-card {
  width: 100%; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 16px; border-radius: 16px; cursor: pointer; font: inherit;
  color: #fff; border: none; background: linear-gradient(135deg, #8b5cf6, #ec4899); box-shadow: 0 6px 18px rgba(124, 58, 237, 0.3);
}
.aitop-card b { font-size: 16px; font-weight: 800; text-shadow: 0 1px 2px rgba(76, 29, 149, 0.45); }
.aitop-card span { font-size: 12.5px; font-weight: 600; opacity: 0.95; text-shadow: 0 1px 2px rgba(76, 29, 149, 0.4); }
.aitop-card:active { transform: scale(0.98); }
.aitop-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--text3); font-size: 12px; font-weight: 700; }
.aitop-or::before, .aitop-or::after { content: ''; flex: 1; height: 1px; background: var(--border2); }
.aitop-custom { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.aitop-custom b { font-size: 14px; font-weight: 800; }
.aitop-custom span { font-size: 12px; font-weight: 600; color: var(--text3); }

/* 상단 [AI 여행 계획] 최근 기록 */
.aitop-recent { display: flex; flex-direction: column; gap: 2px; margin: 16px 0 8px; }
.aitop-recent b { font-size: 14px; font-weight: 800; }
.aitop-recent span { font-size: 12px; font-weight: 600; color: var(--text3); }
.aitop-hist { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; border-radius: 14px; cursor: pointer; font: inherit; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--border2); }
.aitop-hist:active { transform: scale(0.98); }
.aitop-hist .ah-flag { font-size: 26px; flex: 0 0 auto; }
.aitop-hist .ah-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aitop-hist .ah-main b { font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.aitop-hist .ah-main small { font-size: 11.5px; font-weight: 600; color: var(--text3); }
.aitop-hist .ah-state { flex: 0 0 auto; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; color: var(--text3); background: var(--surface2); }
.aitop-hist .ah-state.on { color: #fff; background: var(--accent); }
.aitop-empty { margin: 0; padding: 10px 0; font-size: 12.5px; font-weight: 600; color: var(--text3); }
