:root {
  --bg: #FFF6F2;
  --card: #FFFFFF;
  --ink: #2B2330;
  --sub: #8C8090;
  --line: #F1E6E4;
  --rose: #F2668B;
  --rose-2: #FF9AAE;
  --rose-soft: #FFE8EE;
  --a: #F2668B;
  --b: #7B8CF6;
  --a-soft: #FFE8EE;
  --b-soft: #E9ECFF;
  --gold: #F5B94A;
  --ok: #3DBE8B;
  --radius: 22px;
  --shadow: 0 8px 28px rgba(186, 92, 120, .10);
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom);
  --safe-t: env(safe-area-inset-top);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif; letter-spacing: -0.01em; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: var(--ink); }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--sub); }

/* 버튼 / 입력 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border-radius: 14px; font-weight: 650; font-size: 15px; transition: transform .1s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--rose-2), var(--rose)); color: #fff; box-shadow: 0 6px 16px rgba(242,102,139,.3); }
.btn.soft { background: var(--rose-soft); color: var(--rose); }
.btn.gray { background: #F5F0EF; color: var(--ink); }
.btn.danger { background: #FFECEC; color: #E04848; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 12px; }
.btn svg.i { width: 18px; height: 18px; }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: var(--sub); }
.icon-btn:active { background: var(--rose-soft); }
label { display: block; font-size: 13px; font-weight: 650; color: var(--sub); margin-top: 14px; }
label > input, label > textarea, label > select { display: block; width: 100%; margin-top: 6px; }
input[type=text], input[type=password], input[type=date], input[type=time], textarea {
  border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s;
  -webkit-appearance: none; appearance: none; min-height: 48px;
}
input:focus, textarea:focus { border-color: var(--rose-2); }
textarea { resize: none; min-height: 90px; line-height: 1.5; }
.form-err { color: #E04848; font-size: 13px; min-height: 18px; margin: 10px 0 2px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--rose); margin: 0; }

/* 시작 화면 */
.gate { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 28px 20px; background: radial-gradient(120% 80% at 50% 0%, #FFE1E8 0%, var(--bg) 60%); }
.gate-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 28px; padding: 30px 22px 24px; box-shadow: var(--shadow); }
.gate-logo { width: 58px; height: 58px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--rose-2), var(--rose)); color: #fff; margin-bottom: 16px; }
.gate-logo svg.i { width: 30px; height: 30px; fill: rgba(255,255,255,.25); }
.gate h1 { margin: 0 0 4px; font-size: 24px; font-weight: 800; }
.gate p { margin: 0 0 6px; font-size: 14px; }
.who-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.who-pick button { padding: 16px 10px; border-radius: 18px; border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; }
.who-pick button.on { border-color: var(--rose); background: var(--rose-soft); }
.who-pick .av { width: 44px; height: 44px; font-size: 18px; }

/* 레이아웃 */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 10px) 16px 8px 20px; background: rgba(255,246,242,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 18px; }
.brand .heart { width: 18px; height: 18px; color: var(--rose); fill: var(--rose); }
#view { padding: 4px 16px calc(var(--tab-h) + var(--safe-b) + 24px); max-width: 560px; margin: 0 auto; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: #B9AEB8; position: relative; }
.tabbar button.on { color: var(--rose); }
.tabbar button.on svg.i { stroke-width: 2.1; }
.badge { position: absolute; top: 10px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 2px #fff; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-h h3 { margin: 0; font-size: 16px; font-weight: 750; display: flex; align-items: center; gap: 6px; }
.card-h h3 svg.i { width: 18px; height: 18px; color: var(--rose); }
.card-h .more { font-size: 13px; color: var(--sub); display: flex; align-items: center; }
.card-h .more svg.i { width: 16px; height: 16px; }
.empty { color: var(--sub); font-size: 14px; text-align: center; padding: 18px 8px; line-height: 1.6; }
.av { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 750; font-size: 14px; flex: none; }
.av.a { background: var(--a); } .av.b { background: var(--b); }

/* 홈: 디데이 */
.hero { position: relative; overflow: hidden; border-radius: 28px; padding: 26px 22px 22px; color: #fff; margin-bottom: 14px; background: linear-gradient(140deg, #FFB3C1 0%, #F2668B 55%, #C85BD0 120%); box-shadow: 0 14px 34px rgba(242,102,139,.35); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); }
.hero::before { width: 220px; height: 220px; right: -70px; top: -90px; }
.hero::after { width: 140px; height: 140px; left: -50px; bottom: -70px; }
.hero .pair { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; opacity: .95; position: relative; }
.hero .pair svg.i { width: 16px; height: 16px; fill: #fff; }
.hero .dday { font-size: 58px; font-weight: 850; letter-spacing: -0.04em; line-height: 1; margin: 14px 0 6px; position: relative; }
.hero .dday small { font-size: 22px; font-weight: 700; margin-left: 4px; letter-spacing: 0; }
.hero .since { font-size: 14px; opacity: .9; position: relative; }
.hero .next { margin-top: 18px; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.22); padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 650; position: relative; }
.hero .next svg.i { width: 16px; height: 16px; }

.ann { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ann:first-child { border-top: 0; padding-top: 0; }
.ann .ic { width: 38px; height: 38px; border-radius: 14px; background: var(--rose-soft); color: var(--rose); display: flex; align-items: center; justify-content: center; }
.ann .ic svg.i { width: 18px; height: 18px; }
.ann .t { flex: 1; min-width: 0; }
.ann .t b { display: block; font-size: 15px; }
.ann .t span { font-size: 12px; color: var(--sub); }
.ann .d { font-weight: 800; color: var(--rose); font-size: 15px; }
.ann .x { color: #C9BEC6; }

.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.mini { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.mini .lb { font-size: 12px; color: var(--sub); font-weight: 650; display: flex; align-items: center; gap: 5px; }
.mini .lb svg.i { width: 15px; height: 15px; color: var(--rose); }
.mini .val { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.mini .val small { font-size: 13px; color: var(--sub); font-weight: 600; margin-left: 2px; }
.mini .hint { font-size: 12px; color: var(--sub); }
.progress { height: 8px; border-radius: 8px; background: #F5ECEB; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--rose-2), var(--rose)); transition: width .4s; }

.strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.strip::-webkit-scrollbar { display: none; }
.strip button { flex: none; width: 92px; height: 92px; border-radius: 16px; overflow: hidden; background: #F5ECEB; position: relative; }
.strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip span { position: absolute; left: 6px; bottom: 6px; font-size: 10px; color: #fff; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.4); }

/* 질문 */
.q-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 4px 12px; }
.q-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.q-head span { color: var(--sub); font-size: 13px; }
.q-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px; margin-bottom: 14px; }
.q-type { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--rose); background: var(--rose-soft); padding: 5px 10px; border-radius: 999px; }
.q-type.c { color: var(--b); background: var(--b-soft); }
.q-num { font-size: 12px; color: var(--sub); margin-left: 6px; font-weight: 600; }
.q-text { font-size: 19px; font-weight: 750; line-height: 1.45; margin: 12px 0 16px; word-break: keep-all; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; padding: 18px 10px; border-radius: 18px; border: 2px solid var(--line); background: #fff; font-weight: 700; font-size: 15px; line-height: 1.35; word-break: keep-all; min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; transition: all .15s; }
.choice.mine { border-color: var(--rose); background: var(--rose-soft); }
.choice .who { display: flex; gap: 4px; }
.choice .who .av { width: 24px; height: 24px; font-size: 11px; }
.match { margin-top: 12px; text-align: center; font-size: 14px; font-weight: 700; color: var(--rose); display: flex; align-items: center; justify-content: center; gap: 6px; }
.match svg.i { width: 16px; height: 16px; fill: var(--rose); }
.bubble { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.bubble .body { flex: 1; background: #FBF6F5; border-radius: 4px 18px 18px 18px; padding: 12px 14px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.bubble.a .body { background: var(--a-soft); }
.bubble.b .body { background: var(--b-soft); }
.bubble .nm { font-size: 12px; color: var(--sub); font-weight: 650; margin-bottom: 4px; }
.locked { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: #FBF6F5; color: var(--sub); font-size: 14px; }
.locked svg.i { width: 18px; height: 18px; }
.q-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.arch { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; }
.arch > button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 16px; text-align: left; }
.arch .no { font-size: 12px; color: var(--sub); font-weight: 700; width: 38px; flex: none; }
.arch .tt { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arch .dots { display: flex; gap: 3px; }
.arch .dots i { width: 8px; height: 8px; border-radius: 50%; background: #EDE4E3; }
.arch .dots i.a { background: var(--a); } .arch .dots i.b { background: var(--b); }
.arch .inner { padding: 0 12px 4px; }
.arch .inner .q-card { box-shadow: none; border: 1px solid var(--line); }

/* 캘린더 */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 12px; }
.cal-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.cal-head .nav { display: flex; gap: 4px; }
.cal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 10px 10px; margin-bottom: 14px; }
.dow, .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow span { text-align: center; font-size: 11px; font-weight: 700; color: var(--sub); padding: 4px 0 8px; }
.dow span:first-child, .day.sun .n { color: #E8607B; }
.dow span:last-child, .day.sat .n { color: #6B7FE8; }
.day { position: relative; aspect-ratio: 1 / 1.08; border-radius: 14px; display: flex; flex-direction: column; align-items: center; padding-top: 6px; overflow: hidden; background-size: cover; background-position: center; }
.day.out { opacity: .35; }
.day .n { font-size: 14px; font-weight: 650; position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.day.today .n { background: var(--ink); color: #fff !important; }
.day.sel { box-shadow: inset 0 0 0 2px var(--rose); }
.day.ph::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.05) 60%); }
.day.ph .n { color: #fff !important; }
.day .marks { position: absolute; bottom: 5px; display: flex; gap: 3px; align-items: center; z-index: 1; }
.day .marks i { width: 5px; height: 5px; border-radius: 50%; background: var(--rose); }
.day .marks i.ev-b { background: var(--b); }
.day .marks svg.i { width: 11px; height: 11px; color: var(--rose); fill: var(--rose); stroke-width: 1; }
.day.ph .marks i { box-shadow: 0 0 0 1.5px #fff; }

.day-panel h3 { margin: 0; font-size: 18px; font-weight: 800; }
.day-panel .sub { font-size: 13px; color: var(--sub); margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; background: var(--rose-soft); color: var(--rose); font-size: 13px; font-weight: 700; }
.chip svg.i { width: 14px; height: 14px; fill: var(--rose); stroke-width: 1; }
.chip .del { margin-left: 2px; display: flex; color: #E9A0B2; }
.chip .del svg.i { fill: none; stroke-width: 2; width: 13px; height: 13px; }
.sec-t { font-size: 13px; font-weight: 750; color: var(--sub); margin: 18px 0 8px; display: flex; align-items: center; justify-content: space-between; }
.ev { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #FBF6F5; margin-bottom: 6px; }
.ev .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--a); }
.ev .bar.b { background: var(--b); }
.ev .tm { font-size: 13px; font-weight: 700; color: var(--sub); min-width: 42px; }
.ev .tt { flex: 1; font-size: 15px; font-weight: 600; word-break: break-word; }
.ev .x { color: #C9BEC6; display: flex; }
.ev .x svg.i { width: 18px; height: 18px; }
.add-row { display: flex; gap: 6px; }
.add-row input[type=time] { width: 112px; flex: none; padding: 10px; }
.add-row input[type=text] { flex: 1; min-width: 0; }
.add-row .btn { flex: none; padding: 0 14px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos button { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #F5ECEB; position: relative; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .up { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--rose); font-size: 12px; font-weight: 700; border: 2px dashed #F3C7D2; background: #FFF8FA; }
.photos .up.busy { opacity: .6; pointer-events: none; }

/* 지도 */
#mapWrap { position: fixed; inset: 0; z-index: 10; }
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-bottom-right { bottom: auto !important; top: calc(var(--safe-t) + 64px); }
.map-card { position: absolute; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 24px; box-shadow: 0 10px 34px rgba(60,30,50,.18); padding: 16px; max-width: 520px; margin: 0 auto; }
.dist { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dist .ic { width: 42px; height: 42px; border-radius: 15px; background: linear-gradient(135deg, var(--rose-2), var(--rose)); color: #fff; display: flex; align-items: center; justify-content: center; }
.dist b { font-size: 20px; font-weight: 800; display: block; }
.dist span { font-size: 12px; color: var(--sub); }
.dist .fit { margin-left: auto; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.person { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 16px; background: #FBF6F5; text-align: left; }
.person .meta { min-width: 0; }
.person b { font-size: 14px; display: block; }
.person .meta span { font-size: 11px; color: var(--sub); display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.person .meta span svg.i { width: 12px; height: 12px; }
.map-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.map-actions .btn { padding: 11px 6px; font-size: 13px; }
.map-actions .btn.on { background: #E3F7EE; color: #1E9A68; }
.mk { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.mk .pinv { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 6px 16px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 17px; position: relative; }
.mk .pinv::after { content: ""; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top: 7px solid #fff; }
.mk.live .pinv::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid currentColor; opacity: 0; animation: pulse 2s infinite; }
.mk.a .pinv { background: var(--a); } .mk.a { color: var(--a); }
.mk.b .pinv { background: var(--b); } .mk.b { color: var(--b); }
.mk .lb { margin-top: 10px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.15); white-space: nowrap; }
.mk.old .pinv { filter: grayscale(.6); opacity: .75; }
@keyframes pulse { 0% { transform: scale(.8); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }

/* 버킷 */
.bk-head { background: linear-gradient(140deg, #FFF0F4, #F1EEFF); border-radius: var(--radius); padding: 20px 18px; margin-bottom: 14px; }
.bk-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.bk-head p { margin: 0 0 14px; font-size: 14px; color: var(--sub); }
.bk-head .num { font-size: 13px; font-weight: 700; color: var(--rose); margin-top: 8px; }
.bk { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 8px; }
.bk .ck { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #E8D9DB; display: flex; align-items: center; justify-content: center; color: transparent; flex: none; transition: all .15s; }
.bk .ck svg.i { width: 16px; height: 16px; stroke-width: 2.6; }
.bk.done .ck { background: var(--rose); border-color: var(--rose); color: #fff; }
.bk .tt { flex: 1; min-width: 0; }
.bk .tt b { display: block; font-size: 15px; font-weight: 650; word-break: break-word; }
.bk.done .tt b { color: var(--sub); text-decoration: line-through; text-decoration-color: #E3C9CF; }
.bk .tt span { font-size: 12px; color: var(--sub); }
.bk .x { color: #D4C9D0; display: flex; }
.bk .x svg.i { width: 18px; height: 18px; }

/* 시트 / 라이트박스 / 토스트 */
.sheet-bg { position: fixed; inset: 0; z-index: 100; background: rgba(43,35,48,.4); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet-box { width: 100%; max-width: 560px; max-height: 90dvh; overflow-y: auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 12px 20px calc(var(--safe-b) + 22px); animation: up .25s cubic-bezier(.2,.9,.3,1); }
.sheet-box::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 5px; background: #EADFDE; margin: 0 auto 14px; }
.sheet-box h2 { margin: 0 0 4px; font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sheet-box h2 svg.i { color: var(--rose); }
.sheet-box p, .sheet-box li { font-size: 14px; line-height: 1.6; color: #5A4E5C; }
.sheet-box ol { padding-left: 20px; margin: 8px 0; }
.sheet-box hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0 6px; }
.kv { display: flex; align-items: center; gap: 8px; background: #FBF6F5; border-radius: 14px; padding: 10px 12px; margin: 6px 0; }
.kv .k { font-size: 12px; color: var(--sub); width: 74px; flex: none; font-weight: 650; }
.kv .v { flex: 1; font-size: 13px; word-break: break-all; font-family: ui-monospace, Menlo, monospace; }
.kv button { display: flex; padding: 6px; border-radius: 10px; background: #fff; color: var(--sub); }
.kv button svg.i { width: 16px; height: 16px; }
.note { background: #FFF7E6; border-radius: 14px; padding: 12px 14px; font-size: 13px !important; color: #7A5A1E !important; margin-top: 12px; line-height: 1.55; }
.row2 { display: flex; gap: 8px; margin-top: 16px; }
.row2 .btn { flex: 1; }

.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(15,10,15,.94); display: flex; flex-direction: column; animation: fade .2s; }
.lightbox .lb-top { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 10px) 12px 10px; color: #fff; }
.lightbox .lb-top .icon-btn { color: #fff; }
.lightbox .lb-img { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; position: relative; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; display: flex; align-items: center; justify-content: center; }
.lightbox .nav.l { left: 10px; } .lightbox .nav.r { right: 10px; }
.lightbox .lb-bot { padding: 14px 18px calc(var(--safe-b) + 18px); color: #fff; }
.lightbox .lb-bot b { font-size: 16px; display: block; margin-bottom: 2px; }
.lightbox .lb-bot span { font-size: 12px; opacity: .7; }

#toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 16px); transform: translateX(-50%); z-index: 300; background: rgba(43,35,48,.92); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: drop .25s; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid #F3C7D2; border-top-color: var(--rose); animation: rot .8s linear infinite; margin: 30px auto; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- DM 채팅 (인스타 DM 스타일) ---------- */
#chatWrap { position: fixed; left: 0; right: 0; top: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 10; display: flex; flex-direction: column; background: #fff; }
body.typing #chatWrap { bottom: 0; }
body.typing .tabbar { display: none; }
.dm-head { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 10px) 12px 10px 16px; border-bottom: 1px solid #F3EDEC; background: rgba(255,255,255,.95); }
.dm-head .av { width: 38px; height: 38px; font-size: 15px; }
.dm-who { flex: 1; min-width: 0; }
.dm-who b { display: block; font-size: 16px; font-weight: 750; }
.dm-who span { font-size: 12px; color: var(--sub); }
.dm-head .icon-btn { color: var(--rose); }
.dm-head .icon-btn svg.i { width: 24px; height: 24px; }
.dm-list { flex: 1; overflow-y: auto; padding: 12px 12px 6px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.dm-more { display: block; margin: 4px auto 12px; font-size: 12px; color: var(--sub); padding: 6px 12px; border-radius: 999px; background: #F6F1F0; }
.dm-time { text-align: center; font-size: 11px; color: #A99EA8; font-weight: 600; margin: 16px 0 8px; }
.dm-row { display: flex; align-items: flex-end; gap: 6px; margin-top: 2px; }
.dm-row.first { margin-top: 10px; }
.dm-row.me { justify-content: flex-end; }
.dm-row .av { width: 26px; height: 26px; font-size: 11px; }
.dm-row .av-sp { width: 26px; flex: none; }
.dm-bub { position: relative; max-width: 72%; padding: 9px 13px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; border-radius: 22px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.dm-row.ot .dm-bub { background: #F1EEF0; color: var(--ink); }
.dm-row.me .dm-bub { color: #fff; background: linear-gradient(135deg, #FF8FA3, #F2668B 50%, #B65FE0); background-attachment: fixed; }
.dm-row.ot:not(.first) .dm-bub { border-top-left-radius: 6px; }
.dm-row.ot:not(.last) .dm-bub { border-bottom-left-radius: 6px; }
.dm-row.me:not(.first) .dm-bub { border-top-right-radius: 6px; }
.dm-row.me:not(.last) .dm-bub { border-bottom-right-radius: 6px; }
.dm-bub a { color: inherit; text-decoration: underline; }
.dm-row.liked { margin-bottom: 14px; }
.dm-like { position: absolute; bottom: -14px; display: inline-flex; align-items: center; gap: 2px; background: #fff; border-radius: 999px; padding: 2px 5px; box-shadow: 0 1px 4px rgba(0,0,0,.15); font-size: 10px; font-weight: 700; color: var(--ink); }
.dm-row.ot .dm-like { left: 8px; } .dm-row.me .dm-like { right: 8px; }
.dm-like svg.i { width: 12px; height: 12px; color: #F2466B; fill: #F2466B; stroke-width: 1; }
.dm-pop { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; color: #fff; fill: #F2466B; pointer-events: none; animation: dmpop .7s ease-out forwards; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
@keyframes dmpop { 0% { transform: scale(0); opacity: 0; } 30% { transform: scale(1.25); opacity: 1; } 60% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.1) translateY(-14px); opacity: 0; } }
.dm-seen { text-align: right; font-size: 11px; color: #A99EA8; font-weight: 600; margin: 4px 6px 0; }
.dm-empty { text-align: center; color: var(--sub); font-size: 14px; margin-top: 30vh; line-height: 1.7; }
.dm-input { padding: 8px 12px calc(8px); background: #fff; }
body.typing .dm-input { padding-bottom: 8px; }
.dm-pill { display: flex; align-items: center; gap: 6px; border: 1.5px solid #EDE6E5; border-radius: 999px; padding: 4px 6px 4px 16px; min-height: 46px; }
.dm-pill input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 16px; background: transparent; padding: 8px 0; min-height: 0; }
.dm-pill button { color: var(--rose); font-weight: 750; font-size: 15px; padding: 8px 10px; }

/* ---------- 폰 맞대기 ---------- */
#near { position: fixed; inset: 0; z-index: 150; background: linear-gradient(170deg, #FFE3EA, #FFF6F2 45%, #EEF0FF); display: flex; flex-direction: column; align-items: center; padding: calc(var(--safe-t) + 14px) 24px calc(var(--safe-b) + 24px); animation: fade .2s; }
#near .nx { align-self: flex-end; }
#near h2 { margin: 6px 0 6px; font-size: 22px; font-weight: 800; text-align: center; }
#near p { margin: 0; color: var(--sub); font-size: 14px; line-height: 1.6; text-align: center; }
.near-orb { position: relative; width: 210px; height: 210px; margin: 36px 0 28px; display: flex; align-items: center; justify-content: center; gap: 0; }
.near-orb::before, .near-orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(242,102,139,.35); animation: orb 2.4s infinite ease-out; }
.near-orb::after { animation-delay: 1.2s; }
.near-orb.idle::before, .near-orb.idle::after { animation: none; opacity: 0; }
@keyframes orb { from { transform: scale(.55); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.near-orb .av { width: 74px; height: 74px; font-size: 28px; border: 4px solid #fff; box-shadow: 0 8px 20px rgba(0,0,0,.12); position: relative; z-index: 1; transition: transform .2s; }
.near-orb .av.b { margin-left: -14px; }
.meter { width: 100%; max-width: 300px; }
.meter .bar { height: 10px; border-radius: 10px; background: #F1E6E8; overflow: hidden; }
.meter .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--b), var(--rose)); transition: width .08s; border-radius: 10px; }
.meter .lb { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); margin-top: 6px; font-weight: 600; }
.near-opts { width: 100%; max-width: 300px; margin-top: 18px; }
.near-opts input[type=range] { width: 100%; accent-color: var(--rose); }
.near-status { margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--rose); min-height: 18px; text-align: center; }
#near .btn.block { max-width: 300px; margin-top: auto; }

/* ---------- 닿았을 때 애니메이션 ---------- */
#fx { position: fixed; inset: 0; z-index: 500; overflow: hidden; background: radial-gradient(circle at 50% 45%, #FFA0B9, #C44878 75%); animation: fxin .35s ease-out; display: block; }
@keyframes fxin { from { opacity: 0; } }
.fx-glow { position: absolute; left: -30%; right: -30%; top: -60%; height: 90%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.95), rgba(255,255,255,0)); animation: glow 1.1s ease-out forwards; }
@keyframes glow { 0% { transform: translateY(-40%) scaleY(.4); opacity: 0; } 35% { opacity: 1; } 100% { transform: translateY(35%) scaleY(1.2); opacity: 0; } }
.fx-heart, .fx-big { position: absolute; left: 50%; top: 44%; width: 92px; height: 92px; margin: -46px 0 0 -46px; }
.fx-heart svg, .fx-big svg { width: 100%; height: 100%; }
.fx-heart.l { color: #fff; animation: hl .9s cubic-bezier(.5,0,.3,1) forwards; }
.fx-heart.r { color: #FFD3DE; animation: hr .9s cubic-bezier(.5,0,.3,1) forwards; }
@keyframes hl { from { transform: translateX(-75vw) rotate(-25deg); } 85% { opacity: 1; } to { transform: translateX(-6px) rotate(0); opacity: 0; } }
@keyframes hr { from { transform: translateX(75vw) rotate(25deg); } 85% { opacity: 1; } to { transform: translateX(6px) rotate(0); opacity: 0; } }
.fx-big { width: 150px; height: 150px; margin: -75px 0 0 -75px; color: #fff; transform: scale(0); animation: big 1.6s .85s cubic-bezier(.3,1.6,.5,1) forwards; filter: drop-shadow(0 10px 30px rgba(120,20,60,.35)); }
@keyframes big { 0% { transform: scale(0); } 25% { transform: scale(1.15); } 40% { transform: scale(.95); } 55% { transform: scale(1.08); } 70%, 100% { transform: scale(1); } }
.fx-ring { position: absolute; left: 50%; top: 44%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 3px solid rgba(255,255,255,.9); opacity: 0; animation: ring 1.4s ease-out forwards; }
.fx-ring.r1 { animation-delay: .88s; } .fx-ring.r2 { animation-delay: 1.05s; } .fx-ring.r3 { animation-delay: 1.25s; }
@keyframes ring { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(4.5); opacity: 0; } }
.fx-sparks { position: absolute; left: 50%; top: 44%; }
.fx-sparks i { position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); margin: calc(var(--s) / -2); border-radius: 50%; background: #fff; opacity: 0; animation: spark 1.1s calc(.9s + var(--dl)) ease-out forwards; }
.fx-sparks i:nth-child(3n) { background: #FFE07A; } .fx-sparks i:nth-child(3n+1) { background: #FFC2D1; }
@keyframes spark { 0% { transform: rotate(var(--a)) translateY(0); opacity: 1; } 100% { transform: rotate(var(--a)) translateY(calc(var(--d) * -1)); opacity: 0; } }
.fx-text { position: absolute; left: 0; right: 0; top: calc(44% + 110px); text-align: center; color: #fff; opacity: 0; animation: ftxt .6s 1.3s ease-out forwards; }
.fx-text b { display: block; font-size: 24px; font-weight: 850; letter-spacing: -0.02em; }
.fx-text span { display: block; margin-top: 6px; font-size: 15px; opacity: .9; font-weight: 600; }
@keyframes ftxt { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.touch-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; }
.touch-card .ic { width: 46px; height: 46px; border-radius: 16px; background: linear-gradient(135deg, #FFB3C1, #B65FE0); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.touch-card b { display: block; font-size: 15px; font-weight: 750; }
.touch-card span { font-size: 12px; color: var(--sub); line-height: 1.45; display: block; margin-top: 2px; }
