/* 여행 지도 — 공통 토큰·기본 요소. PC(pc.css)·폰(m.css) 이 같이 쓴다. */
:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f1efea;
  --surface-3: #e8e5de;
  --text: #1c1b19;
  --text-2: #5f5b54;
  --text-3: #8c877e;
  --border: #e4e1da;
  --primary: #0e7c66;
  --primary-hover: #0b6956;
  --primary-ink: #ffffff;
  --primary-soft: #e2f1ec;
  --warn: #b45309;
  --warn-soft: #fdf1e2;
  --danger: #c2410c;
  --danger-soft: #fdeee6;
  --ok: #15803d;
  --ok-soft: #e5f5ea;
  --scrim: rgba(20, 18, 15, .45);
  --shadow-1: 0 1px 2px rgba(28, 27, 25, .06), 0 2px 8px rgba(28, 27, 25, .06);
  --shadow-2: 0 2px 6px rgba(28, 27, 25, .08), 0 12px 32px rgba(28, 27, 25, .14);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111312; --surface: #1a1d1b; --surface-2: #232725; --surface-3: #2c312e;
    --text: #ecebe7; --text-2: #b3b1aa; --text-3: #84827c; --border: #2e3330;
    --primary: #3bb898; --primary-hover: #4fc7a8; --primary-ink: #04241d; --primary-soft: #16322b;
    --warn: #f0a24b; --warn-soft: #3a2a14; --danger: #f08156; --danger-soft: #3b2017;
    --ok: #5fcf86; --ok-soft: #15301f; --scrim: rgba(0, 0, 0, .6);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 12px 32px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111312; --surface: #1a1d1b; --surface-2: #232725; --surface-3: #2c312e;
  --text: #ecebe7; --text-2: #b3b1aa; --text-3: #84827c; --border: #2e3330;
  --primary: #3bb898; --primary-hover: #4fc7a8; --primary-ink: #04241d; --primary-soft: #16322b;
  --warn: #f0a24b; --warn-soft: #3a2a14; --danger: #f08156; --danger-soft: #3b2017;
  --ok: #5fcf86; --ok-soft: #15301f; --scrim: rgba(0, 0, 0, .6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 12px 32px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: var(--primary); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.lg { min-height: 52px; font-size: 16px; border-radius: 14px; padding: 0 20px; }
.btn.icon-only { width: 40px; padding: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 입력 */
.field { display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); outline: none; transition: border-color .15s; }
.field:focus { border-color: var(--primary); }
textarea.field { resize: vertical; min-height: 64px; }
.label { display: block; margin: 0 0 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }

/* 칩 */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; color: var(--text-2); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--primary)); flex: none; }

/* 로그인 */
/* 로그인: 화면 가로·세로 정가운데 */
.login-wrap { position: fixed; inset: 0; overflow-y: auto; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow-1); }
.login-card .brand-mark { display: block; width: 56px; height: 56px; margin: 0 auto 14px; }
.login-card h1 { margin: 0; text-align: center; font-size: 22px; letter-spacing: -.02em; }
.login-card p.sub { margin: 4px 0 24px; text-align: center; color: var(--text-2); font-size: 14px; }
.login-card form { display: grid; gap: 14px; }
.login-card .err { min-height: 20px; margin: 0; color: var(--danger); font-size: 13px; }

/* 토스트 */
.toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: grid; gap: 8px; z-index: 1000; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-2);
  font-size: 14px; font-weight: 500; animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* 메뉴 팝오버 */
.menu { position: absolute; min-width: 200px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px; z-index: 900; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu .who b { display: block; }
.menu .who span { font-size: 12px; color: var(--text-3); }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0;
  background: none; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); text-decoration: none;
  font-size: 14px; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }

/* 올릴 사진 카드 (PC 모달·폰 목록 공통) */
.u-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); position: relative; }
.u-thumb { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.u-thumb img { width: 100%; height: 100%; object-fit: cover; }
.u-thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3);
  font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.u-thumb .bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--primary); transition: width .2s; }
.u-thumb .badge { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; }
.u-remove { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.u-body { display: grid; gap: 8px; min-width: 0; align-content: start; padding-right: 30px; }
.u-loc { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; }
.u-loc .t { min-width: 0; flex: 1; }
.u-loc .t b { display: block; font-size: 13px; }
.u-loc .t span { display: block; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-loc.ok { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: var(--primary-soft); }
.u-loc.ok .icon { color: var(--primary); }
.u-loc.need { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: var(--warn-soft); }
.u-loc.need .icon, .u-loc.need b { color: var(--warn); }
.u-loc .chev { color: var(--text-3); width: 18px; height: 18px; }
.u-body .field { padding: 8px 10px; font-size: 14px; }
.u-body textarea.field { min-height: 44px; }
.u-state { font-size: 13px; font-weight: 600; }
.u-state.err { color: var(--danger); }
.u-state.ok { color: var(--ok); }
.u-card[data-status="uploading"] .u-body, .u-card[data-status="done"] .u-body { opacity: .7; pointer-events: none; }
.u-card[data-status="done"] .u-state { pointer-events: auto; }

/* 위치 고르기 (폰: 전체 화면, PC: 가운데 큰 창) */
.picker-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 800; display: grid; place-items: center; }
.picker { position: relative; display: grid; grid-template-rows: auto 1fr auto; background: var(--surface);
  width: min(980px, 94vw); height: min(720px, 90vh); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-2); }
.picker-top { display: flex; gap: 8px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
.picker-top h2 { margin: 0 8px 0 4px; font-size: 16px; white-space: nowrap; }
.picker-search { position: relative; flex: 1; display: flex; gap: 6px; }
.picker-search .field { padding-left: 38px; }
.picker-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.picker-results { position: absolute; top: 64px; left: 12px; right: 12px; max-height: 50%; overflow: auto; z-index: 5;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-2); }
.picker-results button { display: block; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border);
  background: none; text-align: left; cursor: pointer; }
.picker-results button:hover, .picker-results button:focus { background: var(--surface-2); }
.picker-results b { display: block; font-size: 14px; }
.picker-results span { font-size: 12px; color: var(--text-2); }
.picker-results .empty { padding: 14px; color: var(--text-2); font-size: 14px; }
.picker-map { position: relative; min-height: 0; background: var(--surface-2); }
.picker-map .map { position: absolute; inset: 0; }
.center-pin { position: absolute; left: 50%; top: 50%; width: 40px; height: 52px; transform: translate(-50%, -100%);
  pointer-events: none; z-index: 3; transition: transform .15s ease-out; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); }
.picker-map.moving .center-pin { transform: translate(-50%, calc(-100% - 10px)); }
.center-shadow { position: absolute; left: 50%; top: 50%; width: 12px; height: 5px; margin: -2px 0 0 -6px; border-radius: 50%;
  background: rgba(0, 0, 0, .35); z-index: 2; pointer-events: none; }
.picker-fab { position: absolute; right: 12px; bottom: 12px; z-index: 4; box-shadow: var(--shadow-2); }
.picker-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 4; background: var(--surface);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; box-shadow: var(--shadow-1); color: var(--text-2); white-space: nowrap; }
.picker-bottom { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); flex-wrap: wrap; }
.picker-addr { flex: 1; min-width: 200px; }
.picker-addr b { display: block; font-size: 15px; }
.picker-addr span { font-size: 13px; color: var(--text-2); }
.picker-apply { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.picker-apply input { width: 18px; height: 18px; accent-color: var(--primary); }
.picker-manual { padding: 24px; display: grid; gap: 12px; align-content: start; }
.picker-manual p { margin: 0; color: var(--text-2); font-size: 14px; }
.picker-manual .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 760px) {
  .picker { width: 100%; }
  .picker-top h2 { display: none; }
  .picker-bottom { flex-direction: column; align-items: stretch; }
  .picker-bottom .btn.primary { min-height: 52px; font-size: 16px; }
}

.u-row { display: grid; grid-template-columns: 1fr 210px; gap: 8px; }
.u-date { position: relative; display: block; }
.u-date .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px;
  color: var(--text-3); pointer-events: none; }
.u-date .field { padding-left: 32px; min-height: 38px; }
@media (max-width: 520px) { .u-row { grid-template-columns: 1fr; } }
.login-foot { margin: 18px 0 0; text-align: center; font-size: 12px; color: var(--text-3); }
.picker-grab { display: none; }
.picker-scrim.closing { opacity: 0; transition: opacity .18s; }

/* 폰: 위치 고르기는 아래에서 올라오는 시트 */
@media (max-width: 760px) {
  .picker-scrim { place-items: end stretch; }
  .picker { height: calc(100dvh - 28px); border-radius: 20px 20px 0 0; animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1); }
  .picker-grab { display: block; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px;
    border-radius: 2px; background: var(--surface-3); z-index: 6; }
  .picker-top { padding-top: 16px; }
  .picker-results { top: 70px; }
}
@keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } }

/* 확인·입력 창 */
.dlg-scrim { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: 16px; background: var(--scrim);
  animation: dlg-fade .15s ease-out; }
.dlg-scrim.closing { opacity: 0; transition: opacity .15s; }
.dlg { width: min(420px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--surface);
  border-radius: 18px; box-shadow: var(--shadow-2); overflow: hidden; animation: dlg-in .18s cubic-bezier(.2, .9, .3, 1.1); outline: none; }
.dlg.wide { width: min(880px, 100%); }
@keyframes dlg-fade { from { opacity: 0; } }
@keyframes dlg-in { from { transform: translateY(8px) scale(.97); opacity: 0; } }
.dlg-head { display: flex; align-items: flex-start; gap: 8px; padding: 20px 14px 0 22px; }
.dlg-ttl { flex: 1; min-width: 0; padding-top: 4px; }
.dlg-ttl h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.dlg-ttl p { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.dlg-body { padding: 14px 22px 4px; overflow-y: auto; }
.dlg-msg { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.dlg-actions { display: flex; gap: 8px; padding: 18px 22px 22px; }
.dlg-actions .btn { flex: 1; min-height: 46px; border-radius: 12px; font-size: 15px; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-fill:hover { filter: brightness(1.06); }
/* 확인 창: 사진 미리보기 */
.dlg-preview { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 12px; border-radius: 12px; background: var(--surface-2); }
.dlg-preview img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-3); }
.dlg-preview b { display: block; font-size: 15px; }
.dlg-preview span { font-size: 13px; color: var(--text-2); }
/* 폰: 아래에서 올라오는 시트 */
@media (max-width: 520px) {
  .dlg-scrim { place-items: end stretch; padding: 0; }
  .dlg { width: 100%; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: dlg-up .22s cubic-bezier(.2, .8, .2, 1); }
  .dlg.wide { width: 100%; }
  @keyframes dlg-up { from { transform: translateY(30%); opacity: .5; } }
}

/* 입력 묶음 (모달 안) */
.f { display: block; margin-bottom: 14px; }
.f .hint { display: block; margin-top: 5px; font-size: 12px; color: var(--text-3); }
.f-row { display: flex; align-items: flex-end; gap: 8px; }
.f-row .f { flex: 1; margin-bottom: 0; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); margin: 4px 0 8px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--primary); }
.sep { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.pw-wrap { display: flex; gap: 4px; }
.pw-wrap .field { flex: 1; font-family: ui-monospace, Consolas, monospace; letter-spacing: .02em; }
.handoff { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); font: 14px/1.7 ui-monospace, Consolas, monospace;
  white-space: pre-wrap; word-break: break-all; user-select: all; }
/* 계정 관리 */
.acct-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.acct-count { font-size: 13px; color: var(--text-2); }
.acct-list { display: grid; gap: 6px; }
.acct { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.acct.off { opacity: .6; }
.acct .av { width: 38px; height: 38px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center;
  font-weight: 700; flex: none; }
.acct .tx { flex: 1; min-width: 0; }
.acct .tx b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.acct .tx b small { font-weight: 400; color: var(--text-3); }
.acct .tx > span { display: block; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tag.admin { background: var(--primary-soft); color: var(--primary); }
.tag.off { background: var(--danger-soft); color: var(--danger); }
.acct .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.acct .acts .btn { min-height: 32px; padding: 0 10px; font-size: 13px; }
.acct-empty { padding: 24px; text-align: center; color: var(--text-3); font-size: 14px; }
@media (max-width: 640px) {
  .acct { flex-wrap: wrap; }
  .acct .acts { width: 100%; justify-content: flex-start; }
}
