/* 플레이스매니져 공통 디자인: 색·글꼴·사이드바·상단바·탭바·푸터·공용 부품 */
/* Pretendard Variable (OFL-1.1) — 외부 연결 없이 이 서버에서 내려받는다 */
@font-face { font-family: 'Pretendard Variable'; font-weight: 45 920; font-style: normal; font-display: swap; src: url('/assets/fonts/PretendardVariable.woff2') format('woff2-variations'), url('/assets/fonts/PretendardVariable.woff2') format('woff2'); }

:root {
  --bg: #F2F4F6;
  --card: #FFFFFF;
  --ink: #191F28;
  --ink2: #4E5968;
  --ink3: #6B7684;
  --ink4: #8B95A1;
  --line: #E5E8EB;
  --line2: #D1D6DB;
  --blue: #0B5BD3;
  --blue-hover: #0A4FB8;
  --blue-soft: #EAF2FE;
  --blue-deep: #1D4F9C;
  --blue-tint: rgba(11, 91, 211, 0.08);
  --green: #065F46;
  --green-soft: #E7F5EE;
  --orange-soft: #FFF3E8;
  --orange-text: #93400B;
  --red: #9B1C22;
  --kakao: #FEE500;
  --r: 14px;
  --sidebar: 232px;
  --gap: 26px;
  --page-max: 720px;
  --shadow-sm: 0 1px 3px rgba(25, 31, 40, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.055);
  --ease: cubic-bezier(.23, 1, .32, 1);
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html[data-font='large'] { font-size: 112%; }
html[data-font='xlarge'] { font-size: 125%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(11, 91, 211, 0.35); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── 바깥 틀 ───────────────────────────────────────── */
body.shell { padding: 0 var(--gap) 0 calc(var(--sidebar) + var(--gap)); }
.page { max-width: var(--page-max); margin: 0 auto; padding: 26px 0 40px; }
.page.narrow { max-width: 648px; }

/* 사이드바 (데스크톱) */
.sb {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar);
  background: #fff; padding: 18px 14px 20px; overflow-y: auto; z-index: 40;
}
.sb-brand { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(140deg, #2F7BF0 0%, #0B5BD3 55%, #0A3F9C 100%);
  color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 15px; letter-spacing: -0.5px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.logo-mark::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #FFD43B; position: absolute; transform: translate(9px, -9px); }
.wordmark { display: flex; flex-direction: column; line-height: 1.15; }
.wordmark b { font-size: 18px; font-weight: 900; letter-spacing: -0.3px; }
.wordmark small { font-size: 12.5px; font-weight: 800; color: var(--ink2); }
.sb-nav { margin-top: 26px; display: flex; flex-direction: column; gap: 4px; }
.sb-row { display: flex; align-items: center; min-height: 44px; }
.sb-main {
  flex: 1; display: flex; align-items: center; height: 44px; padding-left: 12px;
  border-radius: 12px; font-size: 17px; font-weight: 700; color: var(--ink);
}
.sb-main:hover { background: #F7F8FA; }
.sb-row.active .sb-main { background: var(--bg); }
.sb-toggle { width: 44px; height: 44px; border: 0; background: none; color: var(--ink2); display: grid; place-items: center; border-radius: 12px; }
.sb-toggle svg { transition: transform .2s var(--ease); }
.sb-row.open .sb-toggle svg { transform: rotate(180deg); }
.sb-sub { display: none; flex-direction: column; gap: 2px; margin: 2px 0 6px 18px; padding-left: 6px; border-left: 1px solid var(--line); }
.sb-row.open + .sb-sub { display: flex; }
.sb-sub a { display: flex; align-items: center; height: 36px; padding: 0 10px; border-radius: 10px; font-size: 15px; font-weight: 700; color: var(--ink2); }
.sb-sub a:hover { background: #F7F8FA; }
.sb-sub a.active { background: var(--blue-soft); color: var(--blue); }

/* 상단 계정 바 (데스크톱) */
.acct-bar {
  position: relative; margin: 0; padding: 13px var(--gap); background: #fff;
  display: flex; justify-content: flex-end; align-items: center; min-height: 71px;
}
.acct-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 4px 12px 4px 4px;
  border-radius: 999px; background: var(--bg); color: var(--ink2); font-size: 15px; border: 0;
}
.acct-chip .initial { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-soft); color: var(--ink); display: grid; place-items: center; font-size: 15px; }
.acct-chip .caret { font-size: 11px; color: var(--ink3); }
.btn-kakao {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 12px;
  background: var(--kakao); color: #191919; font-size: 15px; font-weight: 800;
}
.btn-kakao svg { width: 18px; height: 18px; }
.acct-menu {
  position: absolute; top: 60px; right: var(--gap); width: 240px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12); padding: 8px; z-index: 60;
}
.acct-menu a, .acct-menu button { display: flex; width: 100%; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15px; font-weight: 600; background: none; border: 0; text-align: left; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--bg); }
.acct-menu .meta { padding: 8px 12px 10px; font-size: 13px; color: var(--ink3); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acct-menu .meta b { display: block; color: var(--ink); font-size: 15px; }

/* 상단 계정 바: 왼쪽 가게 고르기, 오른쪽 알림 종 + 계정 */
.acct-bar { justify-content: space-between; gap: 12px; }
.bar-left, .bar-right, .mtop-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.store-pick {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; max-width: 360px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 15px; font-weight: 700;
}
.store-pick svg { color: var(--blue); flex: none; }
.store-pick .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-pick .caret { font-size: 11px; color: var(--ink3); }
.bell-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink2); display: grid; place-items: center; }
.bell-dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #D92D20; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.store-menu, .bell-menu {
  position: absolute; top: 60px; width: 300px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12); padding: 8px; z-index: 60;
}
.store-menu { left: var(--gap); }
.bell-menu { right: var(--gap); width: 340px; }
.store-menu .meta, .bell-menu .meta { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 10px; font-size: 13px; color: var(--ink3); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.bell-menu .meta b { color: var(--ink); font-size: 15px; }
.bell-menu .meta button { border: 0; background: none; color: var(--blue); font-weight: 700; font-size: 13px; min-height: 32px; }
.store-menu button { display: flex; width: 100%; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border-radius: 10px; border: 0; background: none; font-size: 15px; font-weight: 600; text-align: left; color: var(--ink); }
.store-menu button:hover { background: var(--bg); }
.store-menu button svg { color: var(--blue); flex: none; }
.store-menu .sp { width: 18px; flex: none; }
.store-menu .foot { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.store-menu .foot a { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 10px; color: var(--blue); font-size: 14px; font-weight: 700; }
.store-menu .none, .bell-menu .none { padding: 12px 10px; font-size: 14px; color: var(--ink3); }
.bell-menu a { display: block; padding: 10px; border-radius: 10px; }
.bell-menu a:hover { background: var(--bg); }
.bell-menu a b { display: block; font-size: 14.5px; }
.bell-menu a span { display: block; font-size: 13.5px; color: var(--ink2); line-height: 1.5; }
.bell-menu a small { font-size: 12px; color: var(--ink4); }
.bell-menu a.unread { background: var(--blue-soft); }
.page.wide { max-width: 1040px; }

/* 모바일 상단바 */
.mtop { display: none; }

/* 도구·하위 화면 머리말 */
.subbar { margin: 0; background: #fff; border-top: 1px solid #E9ECEF; }
.subbar-in { max-width: var(--page-max); margin: 0 auto; height: 64px; padding: 0 20px; display: flex; align-items: center; gap: 12px; }
.back-btn { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--bg); display: grid; place-items: center; color: var(--ink2); border: 0; }
.subbar-icon { width: 34px; height: 34px; flex: none; border-radius: 12px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.subbar-icon svg { width: 18px; height: 18px; }
.subbar-copy { min-width: 0; }
.subbar-copy h1 { font-size: 17px; font-weight: 700; line-height: 1.4; }
.subbar-copy span { display: block; font-size: 15px; color: var(--ink2); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 푸터 */
.sc-footer { margin: 0; padding: 24px 16px 32px; background: var(--bg); border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink2); }
.sc-footer .in { max-width: var(--page-max); margin: 0 auto; }
.sc-footer .links { display: flex; flex-wrap: wrap; gap: 0 16px; font-weight: 700; }
.sc-footer .links a, .sc-footer .links button { display: inline-flex; align-items: center; min-height: 44px; color: var(--blue); background: none; border: 0; padding: 0; font-size: inherit; font-weight: 700; }
.sc-footer .note { margin-top: 8px; }
.sc-footer .copy { margin-top: 12px; }
.sc-footer .biz { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.sc-footer .biz button { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 4px 8px; border: 0; background: none; border-radius: 12px; color: var(--ink2); font-weight: 700; font-size: inherit; }
.sc-footer .biz-body { text-align: left; padding: 6px 4px 0; line-height: 1.8; }

/* 모바일 하단 탭바 */
.tabbar { display: none; }

/* ── 공용 부품 ─────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px 16px 18px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2 { font-size: 17px; font-weight: 700; line-height: 1.65; }
.more-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-size: 15px; color: var(--blue); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: var(--r); font-size: 17px; font-weight: 700; line-height: 1.3;
  padding: 15px 22px; transition: background .15s, transform .1s;
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-primary[disabled] { background: #9DB8E3; cursor: default; }
.btn-outline { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn-soft { background: var(--blue-soft); color: var(--blue); }
.btn-gray { background: var(--bg); color: var(--ink2); }
.btn-block { width: 100%; }
.btn-sm { font-size: 15px; padding: 9px 14px; border-radius: 12px; }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 15px; padding: 7px 15px; line-height: 1.6; }
.pill-blue { color: var(--blue); background: var(--blue-tint); border: 1px solid rgba(11, 91, 211, 0.22); }
.tag { display: inline-flex; align-items: center; border-radius: 999px; font-size: 13px; font-weight: 700; padding: 3px 10px; background: var(--bg); color: var(--ink2); }
.tag-blue { background: var(--blue-soft); color: var(--blue-deep); }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-orange { background: var(--orange-soft); color: var(--orange-text); }
.section-label { display: block; font-size: 15px; color: var(--blue); line-height: 1.62; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field + .field { margin-top: 16px; }
.field label { font-size: 17px; font-weight: 700; }
.field .hint { font-size: 15px; color: var(--ink3); }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r); background: #fff;
  font-size: 17px; padding: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 91, 211, 0.12); }
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.input.strong { border-color: var(--ink3); }
.input.bad { border-color: var(--red); }
.err-text { color: var(--red); font-size: 15px; }
.ok-text { color: var(--green); font-size: 15px; }

.fold-sign { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; color: var(--ink3); flex: none; transition: transform .2s var(--ease); }
details[open] > summary .fold-sign, .is-open .fold-sign { transform: rotate(180deg); }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }

.note-box { display: flex; gap: 10px; align-items: flex-start; background: var(--blue-soft); border-radius: var(--r); padding: 14px 18px; font-size: 16px; font-weight: 700; }
.note-box svg { flex: none; margin-top: 4px; color: var(--blue); }

.ico-tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ico-tile svg { width: 20px; height: 20px; }

.empty { text-align: center; color: var(--ink3); padding: 28px 12px; font-size: 16px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid #D7E3F8; border-top-color: var(--blue); animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #EEF1F4 0%, #F7F8FA 50%, #EEF1F4 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* 결과 글(마크다운) */
.md { font-size: 16px; line-height: 1.75; color: var(--ink); }
.md h2 { font-size: 17px; font-weight: 800; margin: 18px 0 6px; }
.md h2:first-child { margin-top: 0; }
.md p { margin: 6px 0; }
.md ul { padding-left: 2px; margin: 6px 0; }
.md li { position: relative; padding-left: 16px; margin: 3px 0; }
.md li::before { content: ''; position: absolute; left: 3px; top: 0.75em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink3); }
.md li li::before { background: var(--line2); }
.md blockquote { margin: 0 0 12px; padding: 10px 14px; background: var(--orange-soft); color: var(--orange-text); border-radius: 12px; font-size: 14px; font-weight: 700; }

/* 토스트 · 모달 */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px); opacity: 0;
  background: rgba(25, 31, 40, 0.94); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; font-weight: 600;
  transition: opacity .2s, transform .2s var(--ease); z-index: 200; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.42); z-index: 150; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 420px; background: #fff; border-radius: 24px; padding: 28px 24px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2); }
.modal h2 { font-size: 21px; font-weight: 800; line-height: 1.4; }
.modal p { color: var(--ink2); font-size: 15px; margin-top: 6px; }
.modal .actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.modal .fine { font-size: 12.5px; color: var(--ink3); text-align: center; margin-top: 10px; }

.fab {
  position: fixed; right: 24px; bottom: 24px; width: 48px; height: 48px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: grid; place-items: center; color: var(--ink2); z-index: 30;
}

/* ── 모바일 ────────────────────────────────────────── */
@media (max-width: 767px) {
  body.shell { padding: 0 0 calc(64px + env(safe-area-inset-bottom)); }
  .sb, .acct-bar, .acct-menu { display: none; }
  .mtop {
    display: flex; position: sticky; top: 0; z-index: 40; align-items: center; justify-content: space-between;
    gap: 8px; padding: 12px; background: rgba(242, 244, 246, 0.96); backdrop-filter: saturate(1.4) blur(8px);
  }
  .mtop .brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .mtop .acct-chip { height: 34px; font-size: 15px; max-width: 58vw; padding-right: 10px; }
  .mtop .acct-chip .initial { width: 26px; height: 26px; }
  .mtop .acct-chip .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mtop .btn-kakao { height: 38px; padding: 0 14px; font-size: 14px; }
  .mtop .store-pick { height: 38px; max-width: 62vw; padding: 0 10px; font-size: 14px; }
  .mtop .bell-btn { width: 38px; height: 38px; }
  .mtop .acct-chip { padding: 4px; }
  .mtop .store-menu, .mtop .bell-menu { top: 56px; left: 12px; right: 12px; width: auto; }
  .page { padding: 24px 14px 40px; }
  .subbar { margin: 0; }
  .subbar-in { padding: 0 14px; }
  .sc-footer { margin: 0; padding: 24px 14px 32px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255, 255, 255, 0.98); border-top: 1px solid var(--line); padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 54px; border-radius: 14px; font-size: 11.5px; font-weight: 700; color: var(--ink); }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.active { background: var(--blue-soft); color: var(--blue-deep); }
  .fab { bottom: 84px; right: 16px; }
}
