/* 성성 AI — 단일 CSS. 모바일 우선, 최소 요소 · 색은 성성모두 CI (보라 #16A34A · 진보라 #1A1226 · 배경 #F7F6FB) */
:root {
  --p: #16A34A; --p-dark: #14532D; --p-bg: #E9F8EF;
  --ink: #1A1226; --muted: #6B7280; --line: #E8E5F0; --bg: #F7F6FB;
  --ok: #059669; --warn: #B45309; --warn-bg: #FFFBEB; --err: #DC2626; --err-bg: #FEF2F2;
  --r: 14px;
  /* 표면 색 (다크 모드에서 바뀜) */
  --card: #fff; --soft: #FAFAFC; --soft2: #F1F0F5; --ok-bg: #ECFDF5; --track: #C9C4D8; --bubble: #EEF8F1; --top: #fff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard', sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--p); }
h1 { font-size: 20px; margin: 0 0 10px; }
h2 { font-size: 16px; margin: 18px 0 8px; }
.wrap { max-width: 560px; margin: 0 auto; padding: 12px 14px 40px; }
.top { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-size: 18px; font-weight: 800; color: var(--ink); text-decoration: none; }
.brand b { color: var(--p); }
.top-link { font-size: 13px; text-decoration: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot { text-align: center; font-size: 11px; color: var(--muted); padding: 24px 12px calc(24px + env(safe-area-inset-bottom)); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 12px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.alert { background: var(--err-bg); color: var(--err); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.notice { background: var(--p-bg); color: var(--p-dark); padding: 10px 12px; border-radius: 10px; font-size: 14px; }

.btn { display: inline-block; background: var(--p); color: #fff; border: 0; border-radius: 12px; padding: 12px 18px; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .6; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn.ghost { background: var(--card); color: var(--p); border: 1px dashed var(--p); }
.btn.small { padding: 8px 12px; font-size: 13px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 6px; }
.link.danger { color: var(--err); }

.form label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 0; }
.form input:not([type=checkbox]):not([type=file]) { display: block; width: 100%; margin-top: 6px; padding: 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.form input:focus { outline: 2px solid var(--p-bg); border-color: var(--p); }
.form .check { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }

.pick-list { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow-y: auto; }
.pick-list li { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-list li:last-child { border-bottom: 0; }
.pick-list li small { display: block; color: var(--muted); font-size: 12px; }
.picked { font-size: 14px; color: var(--ok); margin: 6px 0 0; }

.menu3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.menu-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 6px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; background: var(--card); }
.menu-btn .ic { font-size: 26px; }
.menu-btn small { font-weight: 400; color: var(--muted); font-size: 11px; }
.menu-btn.disabled { opacity: .45; pointer-events: none; }

.list { list-style: none; margin: 0; padding: 0; }
.list li a, .list.plain li { display: flex; justify-content: space-between; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 14px; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--line); white-space: nowrap; }
.badge.s-done { background: var(--warn-bg); color: var(--warn); }
.badge.s-confirmed { background: var(--ok-bg); color: var(--ok); }
.badge.s-failed { background: var(--err-bg); color: var(--err); }

.drop { display: block; border: 2px dashed var(--line); border-radius: var(--r); padding: 22px; text-align: center; cursor: pointer; background: var(--card); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop span { font-weight: 700; color: var(--p); }
.drop img { display: block; max-width: 100%; max-height: 320px; margin: 12px auto 0; border-radius: 10px; }

.review { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .wrap:has(.review) { max-width: 1100px; } .review { grid-template-columns: 1fr 1fr; } .review-photo { position: sticky; top: 72px; align-self: start; } }
.review-photo img { width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.uncertain { background: var(--warn-bg); border: 1px solid #FCD34D; color: var(--warn); border-radius: var(--r); padding: 12px 14px; font-size: 14px; }
.uncertain ul { margin: 6px 0 0; padding-left: 18px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 12px; margin: 12px 0; background: var(--card); }
legend { font-weight: 800; font-size: 15px; padding: 0 6px; }
.row { border-bottom: 1px dashed var(--line); padding: 8px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.row .mini { margin: 0; font-size: 11px; font-weight: 600; color: var(--muted); }
.row .mini input { margin-top: 2px; padding: 9px; font-size: 15px; }
.row .mini:first-child { grid-column: 1 / -1; }
.row .link.danger { grid-column: 1 / -1; justify-self: end; }

.spinner { width: 34px; height: 34px; margin: 6px auto 10px; border: 4px solid var(--p-bg); border-top-color: var(--p); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Phase 2 — 쿠폰 관리 */
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.head-row h1 { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.from-ai { background: var(--p-bg); border-radius: var(--r); padding: 10px 12px; margin: 10px 0; }
.from-ai summary { font-weight: 700; color: var(--p-dark); cursor: pointer; }
.coupon-admin { list-style: none; padding: 0; margin: 12px 0; }
.coupon-admin li { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 8px; }
.ca-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ca-actions { display: flex; gap: 4px; justify-content: flex-end; margin-top: 4px; }
.ca-actions form { margin: 0; }

/* Phase 2 — 주민 쿠폰 목록 */
.search input { width: 100%; padding: 13px 14px; font-size: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: 14px; }
.tab small { color: var(--muted); }
.tab.on { background: var(--p); border-color: var(--p); color: #fff; }
.tab.on small { color: #D3F2DE; }
.coupons, .stores { list-style: none; margin: 8px 0; padding: 0; }
.coupon { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 12px 12px 14px; margin-bottom: 8px; }
.coupon-body { flex: 1; min-width: 0; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.c-store { font-size: 13px; color: var(--muted); }
.c-store small { color: #9CA3AF; }
.c-title { font-size: 16px; line-height: 1.35; }
.c-meta { font-size: 12px; color: var(--muted); }
.c-meta .hot { color: var(--err); font-weight: 700; }
.btn.qr { flex: 0 0 auto; padding: 10px 12px; font-size: 13px; }
.empty { text-align: center; padding: 30px 10px; }
.sec { margin-top: 22px; }
.stores li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; font-size: 14px; }
.coupon-detail h1 { margin-top: 4px; }
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 6px 10px; font-size: 14px; margin: 14px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
/* ── Phase 3: 카카오 로그인 · QR ── */
[hidden] { display: none !important; }
.btn.kakao { background: #FEE500; color: #191919; text-align: center; }
.list li a.dim { opacity: .55; }
.qr-card h1 { margin-top: 4px; }
.qr-box { background: var(--card); padding: 8px; margin: 10px auto; max-width: 300px; }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-help { font-size: 17px; font-weight: 800; margin: 6px 0 2px; }
.result { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; margin: 12px 0; border-radius: var(--r); text-align: center; }
.result .big { font-size: 64px; line-height: 1; }
.result b { font-size: 24px; }
.result small { font-size: 15px; color: var(--ink); }
.result.ok { background: var(--ok-bg); color: var(--ok); }
.result.no { background: var(--err-bg); color: var(--err); }
.reader { width: 100%; max-width: 420px; margin: 8px auto; border-radius: var(--r); overflow: hidden; background: #111; min-height: 1px; }
.reader:empty { background: none; }
.reader video { display: block; width: 100%; }
.list.plain li small { white-space: nowrap; }
/* ── Phase 4: 대화형 검색 · 업체 목록 ── */
.pre { white-space: pre-line; }
.form select { display: block; width: 100%; margin-top: 6px; padding: 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
fieldset.kind { margin: 0 0 6px; }
.chat { padding-bottom: 96px; }
.hello { text-align: center; padding: 28px 4px 8px; }
.hello h1 { font-size: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 9px 14px; font-size: 14px; color: var(--ink); cursor: pointer; }
.chip:active { background: var(--p-bg); }
.hello-links { color: var(--muted); }
.clear-chat { display: block; margin: 0 0 0 auto; }
.chat-log { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; }
.msg p { margin: 0; }
.msg.me { align-self: flex-end; background: var(--p); color: #fff; border-radius: 16px 16px 4px 16px; padding: 10px 14px; }
.msg.bot { align-self: flex-start; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 12px 14px; }
.msg.typing p { color: var(--muted); }
.msg .cards { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.msg .route { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.more-link { display: inline-block; margin-top: 8px; font-size: 14px; }
.chat-input { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px; align-items: center; max-width: 560px; margin: 0 auto;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.chat-input input { flex: 1; min-width: 0; padding: 13px 14px; font-size: 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.chat-input input:focus { outline: 2px solid var(--p-bg); border-color: var(--p); }
.chat-input .send, .chat-input .mic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0; font-size: 20px; cursor: pointer; }
.chat-input .send { background: var(--p); color: #fff; font-weight: 800; }
.chat-input .send:disabled { opacity: .5; }
.chat-input .mic { background: var(--card); border: 1px solid var(--line); }
.chat-input .mic.on { background: var(--err-bg); border-color: var(--err); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.quota { position: fixed; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 19; text-align: center; font-size: 11px; margin: 0; pointer-events: none; }
.quota a { pointer-events: auto; }
.store-cards { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.store-card { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.sc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sc-top b { font-size: 15px; }
.sc-meta { font-size: 12px; color: var(--muted); }
.sc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-tags:empty { display: none; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--ink); }
.tag.open { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.tag.closed { background: var(--soft2); color: var(--muted); }
.tag.coupon { background: var(--p-bg); color: var(--p-dark); }
.coupon-mini { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: var(--p-bg); text-decoration: none; color: var(--p-dark); }
.coupon-mini small { color: var(--muted); }
.store-detail h1 { margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-open { margin: 0 0 6px; }
.map-links { display: flex; gap: 8px; flex-wrap: wrap; }
.head-row h1 small { font-size: 14px; font-weight: 400; }
/* ── Phase 5: 관리자 · 영업시간 입력 ── */
.menu4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.hours-row { padding: 8px 12px 10px; }
.hours-row.is-off .hours-times { opacity: .4; }
.hours-times { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.hours-times label { margin-top: 6px; font-size: 12px; }
.hours-times input { padding: 9px !important; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; }
.stat small { color: var(--muted); font-size: 12px; }
.stat b { font-size: 22px; }
.stat span { font-size: 11px; color: var(--muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { border-collapse: collapse; font-size: 12px; width: 100%; white-space: nowrap; }
.tbl th, .tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.tbl th:first-child, .tbl td:first-child, .tbl td:nth-child(3) { text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 520px) { .two-col { grid-template-columns: 1fr 1fr; } .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.rank { margin: 0; padding-left: 22px; font-size: 14px; }
.rank li span { display: inline-block; min-width: 60%; }
.rank li b { float: right; color: var(--muted); font-weight: 600; }
.inline-form { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.inline-form input { flex: 1; min-width: 0; padding: 8px; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; }
.coupon-admin li form.confirm-submit { display: inline-block; margin-top: 6px; }
/* ── 사장님 화면: 왼쪽 업데이트 항목 메뉴 (모든 화면 너비에서 왼쪽) ── */
.wrap.wide { max-width: 1000px; }
.owner-layout { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 10px; align-items: start; }
.owner-main { min-width: 0; }
/* 좁은 화면: 아이콘 + 짧은 이름의 세로 메뉴 */
.owner-side { position: sticky; top: 60px; margin: 12px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 4px;
  max-height: calc(100vh - 72px); overflow-y: auto; scrollbar-width: none; }
.owner-side::-webkit-scrollbar { display: none; }
.side-title, .side-sep, .side-link .sl { display: none; }
.owner-side nav { display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 10px; color: var(--ink); text-decoration: none; text-align: center; }
.side-link .si { font-size: 20px; line-height: 1; }
.side-link .ss { font-size: 10.5px; line-height: 1.2; word-break: keep-all; }
.side-link:hover { background: var(--p-bg); }
.side-link.on { background: var(--p-bg); color: var(--p-dark); font-weight: 700; }
.side-link.disabled { opacity: .4; pointer-events: none; }
/* 넓은 화면: 이름까지 보이는 사이드바 */
@media (min-width: 760px) {
  .owner-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 20px; }
  .owner-side { top: 72px; padding: 12px 8px; }
  .side-title { display: block; font-weight: 800; margin: 2px 8px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-sep { display: block; font-size: 11px; color: var(--muted); margin: 12px 8px 4px; }
  .side-link { flex-direction: row; gap: 8px; padding: 9px 10px; text-align: left; font-size: 14px; }
  .side-link .si { font-size: 16px; }
  .side-link .sl { display: inline; }
  .side-link .ss { display: none; }
}
.autofill { background: var(--p-bg); color: var(--p-dark); border-radius: var(--r); padding: 12px 14px; font-size: 14px; margin: 12px 0; }
.autofill .btn { margin-left: 4px; vertical-align: middle; }
.checklist { list-style: none; margin: 8px 0; padding: 0; }
.checklist li a { display: flex; justify-content: space-between; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.checklist li b { font-size: 13px; color: var(--warn); font-weight: 600; white-space: nowrap; }
.checklist li.done b { color: var(--ok); }
.form textarea { display: block; width: 100%; margin-top: 6px; padding: 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; resize: vertical; }

/* ── 성성모두 CI 로고 · 단색 아이콘 (이모지 대신, lib/icons.js) ── */
.brand { display: inline-flex; align-items: center; }
.brand { gap: 8px; text-decoration: none; }
.brand img { display: block; height: 28px; width: auto; }
.brand-name { font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1; }
.ico { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; stroke-width: 2; }
.top-link { display: inline-flex; align-items: center; gap: 4px; }
.result .big { display: block; line-height: 0; }
.result .big .ico { width: 64px; height: 64px; stroke-width: 1.8; vertical-align: 0; }
.side-link .si { display: inline-flex; }
.side-link .si .ico { width: 22px; height: 22px; vertical-align: 0; }
@media (min-width: 760px) { .side-link .si .ico { width: 18px; height: 18px; } }
.chat-input .send, .chat-input .mic { display: inline-flex; align-items: center; justify-content: center; }
.chat-input .send .ico, .chat-input .mic .ico { width: 22px; height: 22px; vertical-align: 0; }
.chat-input .send .ico { stroke-width: 2.6; }
.checklist .ico, .autofill .ico { color: var(--p); }
.tag .ico { width: 1em; height: 1em; vertical-align: -0.15em; }
.drop .ico { width: 22px; height: 22px; color: var(--p); vertical-align: -0.3em; }

/* ── 가입·로그인 안내 ── */
.top-cta { font-size: 13px; font-weight: 700; color: #fff; background: var(--p); padding: 7px 12px; border-radius: 99px; text-decoration: none; white-space: nowrap; }
.join-cta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 0; }
.join-cta .btn { display: inline-flex; align-items: center; gap: 6px; }
.join-cta p { flex-basis: 100%; margin: 2px 0 0; }
.join-box { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 12px 0; }
.join-box h2 { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.join-box h2 .ico { color: var(--p); }
.join-list { margin: 6px 0 10px; padding-left: 18px; }
.chat-input .mic { color: var(--p); }

.row .mini textarea { display: block; width: 100%; margin-top: 2px; padding: 9px; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; resize: vertical; }
.notice-list { padding-left: 18px; }
.notice-list li { margin-bottom: 12px; }

/* ── 배너 광고 ── */
.ad-banner { position: relative; display: flex; flex-direction: column; gap: 2px; text-align: left; margin: 10px 0 4px; padding: 14px 16px 14px;
  border-radius: var(--r); background: linear-gradient(135deg, #14532D, #16A34A); color: #fff; text-decoration: none; }
.ad-banner b { font-size: 16px; line-height: 1.35; padding-right: 36px; }
.ad-banner span { font-size: 13px; opacity: .9; }
.ad-banner .ad-tag { position: absolute; top: 10px; right: 10px; font-size: 10.5px; padding: 1px 6px; border: 1px solid rgba(255,255,255,.7); border-radius: 4px; opacity: 1; }
.banner-offer { display: flex; flex-direction: column; gap: 4px; background: var(--p-bg); color: var(--p-dark); border-radius: var(--r); padding: 12px 14px; margin: 8px 0; }
.banner-offer > b { font-size: 18px; }
.inline-form input[type=date] { flex: 0 0 auto; }

/* ── 가게 이용권 상태 ── */
.plan-box { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin: 10px 0; font-size: 13px; background: var(--card); }
.plan-box b { font-size: 14px; }
.plan-box.paid { background: var(--ok-bg); border-color: #A7F3D0; }
.plan-box.paid b { color: var(--ok); }
.plan-box .up { color: var(--p-dark); }

.pay-form { display: inline-block; margin: 6px 6px 0 0; }
.badge.s-failed { background: var(--err-bg); color: var(--err); }

/* ── 쿠폰 사용 방법 ── */
.howto { background: var(--p-bg); border-radius: var(--r); padding: 10px 14px; margin: 10px 0 14px; font-size: 14px; text-align: left; }
.howto summary { font-weight: 800; color: var(--p-dark); cursor: pointer; }
.howto summary .ico { color: var(--p); }
.howto ol { margin: 8px 0 6px; padding-left: 20px; }
.howto ol li { margin-bottom: 6px; }
.howto ul { margin: 4px 0 2px; padding-left: 18px; }

/* ── 업체 상세 지도 ── */
.store-map { width: 100%; height: 240px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); margin: 10px 0 4px; background: var(--soft2); }
.map-note { margin: 0 0 6px; }

/* ── 쿠폰 번호 4자리 ── */
.coupon-pin { margin: 10px 0 0; }
.coupon-pin b { font-size: 28px; letter-spacing: .3em; color: var(--p); font-variant-numeric: tabular-nums; margin-left: 6px; }
.pin-entry { margin: 14px 0 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.pin-entry label { font-size: 14px; display: block; margin-bottom: 6px; }
.pin-entry input { letter-spacing: .4em; font-size: 20px; text-align: center; max-width: 150px; }
.result.ask { background: var(--p-bg); color: var(--p-dark); }
.result .btn + .btn { margin-top: 6px; }

/* ── 내 대화 기록 ── */
.msg .msg-at { display: block; font-size: 10.5px; opacity: .75; margin-top: 2px; text-align: right; }
.history-more { display: block; margin: 0 auto 10px; }

/* ── 업체 상세: 소개 · 이벤트·공지 ── */
.intro .tb-p:first-child { font-size: 15.5px; font-weight: 600; }
.tb-p { margin: 0 0 8px; }
.tb-list { margin: 4px 0 10px; padding-left: 0; list-style: none; }
.tb-list li { position: relative; padding: 3px 0 3px 14px; font-size: 14px; line-height: 1.5; }
.tb-list li::before { content: ''; position: absolute; left: 2px; top: .75em; width: 5px; height: 5px; border-radius: 50%; background: var(--p); }
.notice-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: var(--soft); }
.nc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.nc-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--ink); }
.nc-tag.event { background: var(--p-bg); color: var(--p-dark); }
.nc-tag.job { background: var(--ok-bg); color: var(--ok); }
.nc-title { font-size: 15px; flex-basis: 100%; line-height: 1.4; }
.nc-period { font-size: 12px; color: var(--muted); }
.nc-more summary { font-size: 13px; color: var(--p); cursor: pointer; margin: 2px 0 6px; }
.notice-card .tb-p { font-size: 14px; }

.greet { margin: 14px 0 0; font-size: 15px; }
.greet b { color: var(--p-dark); }
.greet .muted { display: block; font-size: 13px; }

/* ── 하단 사업자 정보 · 약관 문서 ── */
.foot { line-height: 1.6; }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--muted); }
.foot-links a { text-decoration: none; }
.wrap:has(.chat) + .foot { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }   /* 첫 화면은 아래 입력창에 가리지 않게 */
.doc h1 { font-size: 22px; margin-top: 6px; }
.doc h2 { font-size: 16px; margin: 22px 0 6px; }
.doc p, .doc li { font-size: 14px; line-height: 1.65; }
.doc ol, .doc ul { padding-left: 20px; }
.doc-draft { background: var(--warn-bg); color: var(--warn); border: 1px solid #FCD34D; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 10px; }
.doc-table th, .doc-table td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.doc-table thead th { background: var(--p-bg); color: var(--p-dark); }
.kv-table th { width: 32%; background: var(--soft); font-weight: 600; }

/* ── 대화 여러 개 ── */
.thread-bar { display: flex; gap: 8px; margin: 8px 0 0; }
.thread-panel { margin: 10px 0; }
.thread-list { list-style: none; margin: 6px 0; padding: 0; }
.thread-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.thread-open { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 9px 2px; text-decoration: none; color: var(--ink); }
.thread-open b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-threads { text-align: left; margin: 12px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; }
.recent-threads p { margin: 0 0 2px; }

/* ── 헤더: AI 남은 횟수 ── */
.top-right { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ai-badge { font-size: 12px; color: var(--p-dark); background: var(--p-bg); border-radius: 99px; padding: 3px 9px; white-space: nowrap; }
.ai-badge b { color: var(--p); }

/* ── 사장님: 검색 상위 노출 강조 ── */
.rank-box { background: linear-gradient(135deg, #14532D, #16A34A); color: #fff; border-radius: var(--r); padding: 14px 16px; margin: 12px 0; }
.rank-box .muted { color: #D3F2DE; }
.rank-lead { margin: 0 0 10px; font-size: 16px; }
.rank-lead .ico { color: #FDE68A; }
.rank-now { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 8px; }
.rank-now div { background: rgba(255,255,255,.12); border-radius: 10px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.rank-now b { font-size: 22px; line-height: 1.2; }
.rank-now small { font-size: 11px; opacity: .85; }
.rank-todo { list-style: none; margin: 6px 0; padding: 0; background: var(--card); border-radius: 10px; color: var(--ink); }
.rank-todo li { border-bottom: 1px solid var(--line); }
.rank-todo li:last-child { border-bottom: 0; }
.rank-todo li > a, .rank-todo li:not(:has(a)) { display: flex; align-items: center; gap: 8px; padding: 9px 12px; color: var(--ink); text-decoration: none; font-size: 14px; }
.rank-todo .rt-label { flex: 1; }
.rank-todo .rt-pts { color: var(--p); }
.rank-todo .rt-mark .ico { color: var(--err); }
.rank-todo li.done { opacity: .6; }
.rank-todo li.done .rt-mark .ico { color: var(--ok); }
.rank-todo li:not(.done) > a .rt-label { font-weight: 700; }
.rank-hint { font-size: 13px; margin: 12px 0 0; color: var(--p-dark); }
.rank-hint .ico { color: var(--p); }

/* ── 대화: 오른쪽 위 '새 대화', 왼쪽 '대화 목록' ── */
.chat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0 0; }
.greet-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 0; }
.greet-row .greet { margin: 0; min-width: 0; }
.greet-row .new-chat { flex: none; white-space: nowrap; }
@media (min-width: 1100px) { .chat-top:not(:has(.btn:not(.side-toggle))) { display: none; } }
.thread-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: 270px; max-width: 82vw; background: var(--card); border-right: 1px solid var(--line);
  padding: calc(14px + env(safe-area-inset-top)) 12px 16px; overflow-y: auto; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 4px 0 20px rgba(0,0,0,.08); }
.thread-side.open { transform: none; }
.side-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; }
.side-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,.3); }
.thread-list li.on { background: var(--p-bg); border-radius: 8px; }
.thread-list li.on .thread-open b { color: var(--p-dark); }
.thread-list li { padding: 0 4px; }
.thread-list .empty-li { padding: 8px 2px; border: 0; }
/* 넓은 화면: 왼쪽에 항상 펼침 */
@media (min-width: 1100px) {
  .thread-side { top: 57px; transform: none; box-shadow: none; padding-top: 14px; }
  .side-toggle, .side-close { display: none; }
  .side-backdrop { display: none !important; }
}

/* ── 업그레이드 ── */
.up-btn { font-size: 12px; font-weight: 700; color: #fff; background: var(--p); border-radius: 99px; padding: 4px 10px; text-decoration: none; white-space: nowrap; }
.ai-badge { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.25; padding: 3px 9px; border-radius: 10px; }
.ai-badge .db-free { font-size: 10.5px; color: var(--muted); }
.plan-table th, .plan-table td { text-align: center; }
.plan-table tbody th { text-align: left; font-weight: 600; background: var(--soft); }
.plan-table .hl { background: var(--p-bg); color: var(--p-dark); font-weight: 700; }
.plan-table thead .hl { background: var(--p); color: #fff; }

/* ── 사장님: 메뉴 접기 · 업데이트/검색 탭 · 업데이트 대화창 ── */
.side-fold { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 4px 0 0; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); cursor: pointer; }
.side-fold:hover { color: var(--p); border-color: var(--p); }
.side-fold .ico { width: 22px; height: 22px; }
.side-fold .when-hidden, .side-hidden .side-fold .when-shown { display: none; }
.side-hidden .side-fold .when-hidden { display: inline-block; }
.owner-layout.side-hidden { grid-template-columns: minmax(0, 1fr); }
.owner-layout.side-hidden .owner-side { display: none; }
.mode-tabs { display: flex; gap: 6px; margin: 10px 0 4px; }
.mode-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.mode-tab.on { background: var(--p); border-color: var(--p); color: #fff; }
.photo-btn { cursor: pointer; }
.msg-photo { display: block; max-width: 220px; max-height: 260px; border-radius: 10px; }
.prop-sec { margin: 8px 0; }
.prop-sec b { font-size: 13px; color: var(--p-dark); }
.prop-sec ul { margin: 2px 0 0; padding-left: 18px; font-size: 14px; }
.prop-warn { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 6px 10px; font-size: 13px; margin: 8px 0; }
.prop-actions { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.prop-actions .link { align-self: center; }
.prop-done { color: var(--ok); font-weight: 700; margin: 0; }
.shop-status { text-align: left; margin: 14px 0 0; }
.shop-status summary { font-weight: 700; color: var(--p-dark); cursor: pointer; }
.logout-form { margin-bottom: 90px; }

/* ── 좁은 화면 넘침 고침 (2026-10-06, 영업시간 칸이 상자 밖으로 나감) ──
   fieldset 은 기본 min-width: min-content 라 내용보다 좁아지지 않는다 / 아이폰 time 입력칸은 최소 폭이 크다 */
fieldset { min-width: 0; }
.hours-times { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.hours-times label { min-width: 0; }
.hours-times input[type="time"] { width: 100%; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; text-align: left; }
.row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.row .mini, .form label, .owner-main, .card { min-width: 0; }
.form input, .form select, .form textarea { max-width: 100%; }
/* 가게 PIN · 쿠폰 사용 확인 화면 (v0.11.1) */
.store-pin { margin: 6px 0 8px; text-align: center; }
.store-pin b { font-size: 40px; letter-spacing: .35em; color: var(--p); font-variant-numeric: tabular-nums; padding-left: .35em; }
.pin-change summary { cursor: pointer; color: var(--p); font-size: 14px; margin: 6px 0; }
.redeem-form { display: flex; flex-direction: column; gap: 10px; text-align: left; margin: 12px 0; }
.redeem-form input[name=pin] { font-size: 32px; text-align: center; letter-spacing: .4em; padding: 10px; }
.big-btn { font-size: 18px; padding: 14px; }
/* 주민 헤더 [더보기] · 내 정보 (v0.12.0) */
.more-menu { position: relative; }
.more-menu > summary { list-style: none; cursor: pointer; color: var(--p); font-weight: 600; padding: 6px 2px; max-width: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > summary .ico { width: 16px; height: 16px; transition: transform .15s; }
.more-menu[open] > summary .ico { transform: rotate(180deg); }
.more-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(26, 18, 38, .12); padding: 6px; display: flex; flex-direction: column; }
.more-pop a, .more-pop button { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; font-size: 15px;
  color: var(--ink); text-decoration: none; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font-family: inherit; }
.more-pop a:hover, .more-pop button:hover { background: var(--p-bg); }
.more-pop .ico { width: 18px; height: 18px; color: var(--p); }
.more-pop form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.mm-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tier { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--soft2); color: var(--muted); white-space: nowrap; }
.tier.premium { background: var(--p); color: #fff; }
.tier .ico { width: 13px; height: 13px; }
.me-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.me-name { font-size: 20px; }
.me .kv { grid-template-columns: 110px minmax(0, 1fr); }
/* 관리자 왼쪽 메뉴 (사장님 메뉴와 같은 모양) — 로그아웃 버튼 */
.side-form { margin: 0; }
.side-form .side-link { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; }
/* 업종별 매장 현황 (성성모두 정보 탭과 같은 3단 펼침) */
.cat-tree { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.ct-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cat-tree summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.cat-tree summary::-webkit-details-marker { display: none; }
.ct-main > summary { padding: 14px 14px; font-weight: 700; font-size: 16px; }
.ct-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--p-bg); color: var(--p); flex: none; }
.ct-icon .ico { width: 20px; height: 20px; }
.ct-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-n { font-size: 13px; font-weight: 600; color: var(--p-dark); background: var(--p-bg); border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.ct-cp { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); font-weight: 500; }
.ct-cp .ico { width: 13px; height: 13px; }
.ct-arrow { display: inline-flex; color: var(--muted); transition: transform .15s; }
.ct-arrow .ico { width: 18px; height: 18px; }
.cat-tree details[open] > summary .ct-arrow { transform: rotate(90deg); }
.ct-main[open] > summary { border-bottom: 1px solid var(--line); background: var(--soft); }
.ct-subs { padding: 4px 0 8px; }
.ct-all { display: block; padding: 8px 16px 6px 60px; font-size: 13px; color: var(--p); text-decoration: none; }
.ct-sub > summary { padding: 11px 14px 11px 60px; font-size: 15px; }
.ct-sub > summary .ct-n { background: var(--soft2); color: var(--ink); font-weight: 500; }
.ct-sub[open] > summary { color: var(--p-dark); font-weight: 600; }
.ct-leaves { list-style: none; margin: 0 12px 6px 60px; padding: 4px 0; border-left: 2px solid var(--p-bg); }
.ct-leaves a { display: flex; align-items: center; gap: 8px; padding: 8px 4px 8px 12px; font-size: 14px; color: var(--ink); text-decoration: none; }
.ct-leaves a > span:first-child { flex: 1; min-width: 0; }
.ct-leaves .ct-n { background: none; color: var(--muted); padding: 0; font-weight: 400; }
.ct-go { font-size: 12px; color: #fff; background: var(--p); border-radius: 8px; padding: 3px 9px; }
.ct-leaves a:hover { background: var(--p-bg); border-radius: 8px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.crumbs a { color: var(--p); text-decoration: none; }
@media (max-width: 380px) { .ct-sub > summary, .ct-all { padding-left: 16px; } .ct-leaves { margin-left: 16px; } }
/* 성성지구 소식 */
.news-mini { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.news-mini b { font-size: 15px; }
.news-mini p { margin: 2px 0; font-size: 14px; }
.news-mini a { font-size: 13px; color: var(--p); text-decoration: none; }
.news-list { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.news-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.news-item p { margin: 0; font-size: 14px; }
.news-item.old { opacity: .65; }
.news-meta { display: flex; align-items: center; gap: 6px; }
/* 사실 바로잡기 */
.fix { margin-top: 6px; }
.fix-link { background: none; border: 0; padding: 2px 0; font: inherit; font-size: 12px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.fix-link:hover { color: var(--p); }
.fix-form { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.fix-form textarea { width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.fix-actions { display: flex; gap: 10px; align-items: center; }
.fix-done { color: var(--ok); }
/* 관리자 경계 미리보기 */
.boundary-map { width: 100%; height: 70vh; min-height: 420px; border-radius: var(--r); border: 1px solid var(--line); margin: 10px 0; }
.bmark { display: inline-block; background: var(--card); border: 2px solid var(--p); color: var(--ink); font-size: 11px; padding: 1px 5px; border-radius: 8px; white-space: nowrap; }
.bmark.warn { border-color: #E8590C; color: #E8590C; font-weight: 700; }
.bmark.out { border-color: #9CA3AF; color: #6B7280; }
.lg-cur { color: #16A34A; } .lg-prop { color: #E8590C; }
/* 첫 화면 대화: 위(인사·대화 목록·배너)는 고정, 아래 칸 안에서만 대화가 쌓이고 위로 밀려 올라감 */
body.chat-app { overflow: hidden; }
.chat.app { position: fixed; z-index: 5; background: var(--bg); left: 0; right: 0; top: var(--top-h, 57px); bottom: 0; max-width: 560px; margin: 0 auto; padding: 0 14px;
  display: flex; flex-direction: column; }
.chat.app > .chat-head, .chat.app > .history-more, .chat.app > .clear-chat { flex: none; }
.chat.app > .chat-head { padding-top: 4px; border-bottom: 1px solid var(--line); padding-bottom: 8px; background: var(--bg); }
.chat.app > .chat-head .ad-banner { margin: 8px 0 0; }
.chat.app > .chat-head .greet-row, .chat.app > .chat-head > .greet { margin-top: 8px; }
.chat.app > .chat-log { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 10px 0 calc(96px + env(safe-area-inset-bottom)); }
.wrap:has(.chat.app) ~ .foot { display: none; }
.foot.foot-inline { margin-top: 28px; padding: 16px 0 0; border-top: 1px solid var(--line); }
@media (min-width: 1100px) { .chat.app:has(.thread-side) { left: 270px; } }
/* 답 글자 써 내려가기 */
.type-wait { display: none !important; }
.type-show { animation: typeShow .35s ease both; }
@keyframes typeShow { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.typing-now::after { content: '▍'; color: var(--p); animation: caret 1s steps(1) infinite; margin-left: 1px; }
@keyframes caret { 50% { opacity: 0; } }
/* 검색 방식 토글 — 끄면 DB 검색, 켜면 AI 검색 (입력창 위) */
.chat-input { flex-wrap: wrap; }
.mode-switch { flex: 0 0 100%; display: flex; gap: 10px; justify-content: center; align-items: center; margin-bottom: 2px; font-size: 13px; }
.ms-label { color: var(--muted); cursor: pointer; user-select: none; }
.ms-label small { font-size: 11px; opacity: .85; }
.mode-switch:not(.on) .ms-db, .mode-switch.on .ms-ai { color: var(--p); font-weight: 700; }
.ms-toggle { position: relative; width: 46px; height: 26px; border-radius: 99px; border: 0; padding: 0; cursor: pointer; background: var(--track); transition: background .2s; }
.ms-toggle .ms-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.ms-toggle[aria-checked="true"] { background: linear-gradient(135deg, #16A34A, #4ADE80); }
.ms-toggle[aria-checked="true"] .ms-knob { transform: translateX(20px); }
.ms-toggle:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }
.chat.app > .chat-log { padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
/* 팔로우 · 알림 */
.bell { position: relative; display: inline-flex; align-items: center; color: var(--p); padding: 4px; }
.bell .ico { width: 22px; height: 22px; }
.bell-n { position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--err); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.mm-n { background: var(--err); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; margin-left: auto; }
.follow-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 2px; }
.follow-row form { margin: 0; }
.follow-row .btn .ico { width: 16px; height: 16px; vertical-align: -3px; }
.follow-row .btn.following { color: var(--p); border-color: var(--p); }
.follower-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--p-dark); background: var(--p-bg); border-radius: 99px; padding: 2px 9px; margin-left: 6px; vertical-align: 2px; }
.follower-chip .ico { width: 14px; height: 14px; }
.follow-hint { display: block; }
.push-box .btn { margin: 6px 0; }
.badge.new { background: var(--err); color: #fff; }
/* 인사 줄 오른쪽: [대화 목록] [새 대화] */
.greet-btns { display: flex; gap: 6px; flex: none; }
.greet-btns .btn { white-space: nowrap; }
@media (max-width: 380px) { .greet-btns .btn { padding-left: 9px; padding-right: 9px; } }
/* 소식 분류: 옆으로 밀지 않고 줄 바꿔 전부 보이게 */
.tabs.tabs-wrap { flex-wrap: wrap; overflow: visible; gap: 6px; }
.tabs.tabs-wrap .tab { flex: none; padding: 6px 12px; font-size: 14px; }

/* 프리미엄 대화 다 참 — 지울 대화 고르기 */
.pick-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.pick-list .btn { width: 100%; text-align: left; justify-content: flex-start; }

/* 주민 헤더 — 좁은 휴대폰에서 '성성AI'가 세로로 접히고 종이 잘리던 문제 (2026-10-07) */
.brand { flex-shrink: 0; }
.brand-name { white-space: nowrap; }
.top { gap: 8px; }
.user-badge { text-decoration: none; }
.user-badge .db-free b { color: var(--p-dark); font-weight: 700; }
@media (max-width: 430px) {
  .top { padding-left: 12px; padding-right: 12px; }
  .top-right { gap: 6px; }
  .ai-badge { padding: 3px 8px; }
}

/* ── 다크 모드 (사용자 요청 2026-10-07: Claude 앱처럼 깔끔하게 · 다크가 눈에 잘 보임) ──
   기본은 휴대폰 설정을 따른다(auto). [더보기 → 화면] 또는 아래쪽 '화면 모드'로 밝게·어둡게 고정 — 쿠키 ssai_theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --p: #4ADE80; --p-dark: #BBF7D0; --p-bg: #1D3A2A;
    --ink: #F2F0EA; --muted: #A5A29A; --line: #3C3B37; --bg: #262624;
    --ok: #34D399; --ok-bg: #133229; --warn: #FBBF24; --warn-bg: #3A3014; --err: #F87171; --err-bg: #3D2020;
    --card: #30302E; --soft: #2C2B29; --soft2: #393835; --track: #4A4945; --bubble: #3A3936; --top: #262624;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --p: #4ADE80; --p-dark: #BBF7D0; --p-bg: #1D3A2A;
  --ink: #F2F0EA; --muted: #A5A29A; --line: #3C3B37; --bg: #262624;
  --ok: #34D399; --ok-bg: #133229; --warn: #FBBF24; --warn-bg: #3A3014; --err: #F87171; --err-bg: #3D2020;
  --card: #30302E; --soft: #2C2B29; --soft2: #393835; --track: #4A4945; --bubble: #3A3936; --top: #262624;
  color-scheme: dark;
}
.top { background: var(--top); }
input, select, textarea { background: var(--card); color: var(--ink); border-color: var(--line); }

/* 대화 — Claude 앱처럼: 내 말은 은은한 말풍선, 답은 바탕 위에 글로 */
.msg.me { background: var(--bubble); color: var(--ink); border-radius: 18px 18px 6px 18px; padding: 10px 15px; }
.msg.me .msg-at { color: var(--muted); }
.msg.bot { background: transparent; border: 0; border-radius: 0; padding: 4px 2px 6px; font-size: 15.5px; line-height: 1.7; }
.msg.bot .cards > * { background: var(--card); }
.chat-log { gap: 18px; }
.chat-input { border-top: 0; background: var(--bg); }
.chat-input input { border-radius: 26px; padding: 14px 18px; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.chat-input .mic { background: var(--card); }
.chip { background: var(--card); color: var(--ink); }
.hello h1 { letter-spacing: -0.02em; }
.chat.app > .chat-head { border-bottom-color: var(--line); }

/* 화면 모드 고르기 */
.theme-pick { display: flex; gap: 4px; padding: 6px 10px 8px; }
.theme-pick button { flex: 1; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 6px 0; font-size: 12.5px; cursor: pointer; }
.theme-pick button.on { border-color: var(--p); color: var(--p); font-weight: 700; }
.theme-pick-label { font-size: 12px; color: var(--muted); padding: 6px 12px 0; }
.foot .theme-pick { justify-content: center; max-width: 260px; margin: 6px auto 0; }

/* 로고: 밝은 화면은 원래 심볼(흰 바탕), 어두운 화면은 투명 바탕 밝은 심볼 */
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo-light { display: none; }
  :root:not([data-theme="light"]) .brand .logo-dark { display: block; }
}

/* ── Claude 앱처럼 단순하게 (사용자 요청 2026-10-07) ── */
/* 헤더: 로고 · 알림 · 더보기만 — AI 남은 횟수는 입력칸의 [AI ○회]와 '내 정보'에 */
.user-badge { display: none !important; }
.top { border-bottom: 0; }
/* 인사 줄: [≡ 대화 목록]  ○○님, 안녕하세요  [새 대화] — 아이콘 버튼 */
.greet-row { gap: 6px; }
.greet-row .greet { flex: 1; text-align: center; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover, .icon-btn:active { background: var(--soft2); }
.icon-btn .ico { width: 22px; height: 22px; }
@media (min-width: 1100px) { .greet-row .side-toggle { visibility: hidden; } }
.chat.app > .chat-head { border-bottom: 0; }
.chat.app > .chat-head .ad-banner { padding: 11px 14px; }
/* 첫 화면: 큰 인사 + 예시는 조용하게 */
.hello { padding-top: 36px; }
.hello h1 { font-size: 24px; font-weight: 700; }
.chip { border-color: var(--line); background: transparent; font-size: 13.5px; padding: 8px 13px; color: var(--ink); }
/* 입력칸: 둥근 상자 하나 — 위에 글, 아래 줄에 [DB | AI ○회] · 마이크 · 보내기 */
.chat-input.composer { display: block; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 0; }
.composer-box { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 10px 10px 8px 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.composer-box:focus-within { border-color: var(--p); }
.chat-input.composer input { display: block; width: 100%; border: 0; outline: 0; background: transparent; padding: 4px 2px 8px; font-size: 16px; box-shadow: none; border-radius: 0; color: var(--ink); }
.chat-input.composer input:focus { outline: 0; }
.composer-row { display: flex; align-items: center; gap: 6px; }
.composer-gap { flex: 1; }
.mode-switch.seg { flex: none; display: inline-flex; gap: 0; margin: 0; padding: 2px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg); }
.mode-switch.seg .ms-label { border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--muted); padding: 5px 12px; border-radius: 99px; cursor: pointer; font-weight: 600; }
.mode-switch.seg .ms-label small { font-size: 11.5px; font-weight: 500; opacity: .85; }
.mode-switch.seg:not(.on) .ms-db, .mode-switch.seg.on .ms-ai { background: var(--p-bg); color: var(--p); }
.chat-input.composer .mic { width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); }
.chat-input.composer .send { width: 36px; height: 36px; }
.chat-input.composer .send .ico, .chat-input.composer .mic .ico { width: 20px; height: 20px; }
.chat.app > .chat-log { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }

/* 사업자 정보 — 한 줄로 접기 */
.biz-fold > summary { list-style: none; cursor: pointer; }
.biz-fold > summary::-webkit-details-marker { display: none; }
.biz-open { text-decoration: underline; }
.biz-fold[open] .biz-open { font-weight: 700; }
.biz-detail { margin-top: 8px; }
.biz-detail p { margin: 0 0 6px; }
.foot.foot-inline { margin-top: 20px; padding-top: 12px; }

/* 도움말 — 오른쪽에서 밀려 나오는 예시 질문 */
.help-open { margin: 14px auto 0; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 13.5px; cursor: pointer; }
.help-open .ico { width: 16px; height: 16px; color: var(--p); }
.help-side { position: fixed; top: 0; bottom: 0; right: 0; z-index: 40; width: 300px; max-width: 86vw; background: var(--card); border-left: 1px solid var(--line);
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto;
  transform: translateX(100%); transition: transform .22s ease, visibility .22s; visibility: hidden; text-align: left; }
.help-side.open { transform: none; visibility: visible; box-shadow: -4px 0 20px rgba(0,0,0,.12); }
#helpBackdrop { position: fixed; inset: 0; background: rgba(0,0,0,.3); }
.help-side .side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.help-side .side-head b { display: inline-flex; align-items: center; gap: 6px; }
.help-side .side-head b .ico { width: 18px; height: 18px; color: var(--p); }
.help-cap { margin: 14px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.help-side .chips { justify-content: flex-start; gap: 6px; margin: 0; }
.help-links { list-style: none; margin: 0; padding: 0; }
.help-links a { display: flex; align-items: center; gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; }
.help-links .ico { width: 18px; height: 18px; color: var(--p); }
#helpBackdrop { z-index: 39; }

.composer-row .help-btn { width: 34px; height: 34px; color: var(--p); border: 1px solid var(--line); }
.composer-row .help-btn .ico { width: 18px; height: 18px; }

/* ── 가게·관리자 화면도 같은 느낌으로 (2026-10-07) ──
   휴대폰: 아이콘 줄 대신 [≡] 버튼 → 왼쪽에서 밀려 나오는 메뉴 · 넓은 화면: 테두리 없는 사이드바 */
.side-menu-btn { display: none; margin-right: 2px; }
.top.has-side .ai-badge { display: none; }
.owner-side { border: 0; background: transparent; box-shadow: none; }
.side-link { border-radius: 10px; }
.side-link.on { background: var(--soft2); color: var(--ink); }
.side-link.on .ico { color: var(--p); }
.side-link:hover { background: var(--soft2); }
#ownerBackdrop { z-index: 49; }
@media (max-width: 759px) {
  .side-menu-btn { display: inline-flex; }
  .top.has-side { justify-content: flex-start; gap: 4px; }
  .top.has-side .top-right, .top.has-side > .top-link { margin-left: auto; }
  .owner-layout { grid-template-columns: minmax(0, 1fr); }
  .owner-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: 260px; max-width: 82vw; margin: 0; border-radius: 0;
    background: var(--card); border-right: 1px solid var(--line); padding: calc(16px + env(safe-area-inset-top)) 10px 20px; overflow-y: auto;
    transform: translateX(-100%); transition: transform .2s ease; visibility: hidden; max-height: none; height: auto; }
  .owner-side.open { transform: none; visibility: visible; box-shadow: 4px 0 20px rgba(0,0,0,.18); }
  .owner-side .side-title { display: block; font-weight: 800; margin: 2px 8px 10px; }
  .owner-side .side-sep { display: block; font-size: 11px; color: var(--muted); margin: 12px 8px 4px; }
  .owner-side .side-link { flex-direction: row; gap: 10px; padding: 11px 10px; text-align: left; font-size: 15px; }
  .owner-side .side-link .sl { display: inline; }
  .owner-side .side-link .ss { display: none; }
  .owner-side .side-link .si .ico { width: 20px; height: 20px; }
  .side-fold { display: none; }
}
@media (min-width: 760px) {
  .owner-side { padding: 8px 4px; }
  .owner-layout { gap: 28px; }
}
.card { border-radius: 16px; }

/* CI (2026-10-07 사용자 선택 13번): 궤도(2시 방향 열림 + 위성 점) + 고딕 ^^ — img/mark.svg · mark-dark.svg · mark-app.svg */
.brand img { width: 32px; height: 32px; }
.brand-name b { background: linear-gradient(90deg, #16A34A, #2DD4BF); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 가게 첫 화면 단순하게 · 휴대폰 메뉴가 '접기' 기억에 막히지 않게 (2026-10-07) */
@media (max-width: 759px) { .owner-layout.side-hidden .owner-side { display: block; } }
.owner-greet { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 0; }
.owner-greet .greet { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-tabs { display: flex; width: fit-content; margin: 12px auto 4px; gap: 0; padding: 2px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg); }
.mode-tab { flex: none; border: 0; background: transparent; color: var(--muted); border-radius: 99px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; }
.mode-tab .ico { width: 16px; height: 16px; }
.mode-tab.on { background: var(--p-bg); color: var(--p); border: 0; }
.shop-status-in .checklist, .shop-status-in .list { margin-top: 6px; }
.help-side h2 { font-size: 14px; margin: 14px 0 6px; }

.mm-quota { margin: 0 0 4px; padding: 0 12px 8px; font-size: 12.5px; color: var(--ink); border-bottom: 1px solid var(--line); }
.mm-quota b { color: var(--p); }



/* 탈퇴 */
.withdraw-list { padding-left: 18px; margin: 10px 0 16px; line-height: 1.7; font-size: 14px; }
.danger-btn { background: var(--err); }
.more-pop a.mm-small { font-size: 12px; color: var(--muted); justify-content: flex-end; padding: 6px 12px; }

/* [더보기] 안 화면 모드 버튼 — 메뉴 버튼 규칙(왼쪽 정렬·넓은 여백)을 덮어 가운데로 */
.more-pop .theme-pick button { flex: 1; width: auto; display: flex; align-items: center; justify-content: center; text-align: center; padding: 7px 0; gap: 0; border: 1px solid var(--line); border-radius: 8px; }
.more-pop .theme-pick button.on { border-color: var(--p); color: var(--p); }

/* 약관·처리방침 위쪽 [닫기] */
.doc-close-bar { position: sticky; top: calc(var(--top-h, 57px) + 4px); z-index: 5; display: flex; justify-content: flex-end; margin: 8px 0 -4px; }
.doc-close { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.doc-close .ico { width: 16px; height: 16px; }

/* 약관·처리방침 표 — 휴대폰에서 첫 칸이 한 글자씩 세로로 깨지던 것: 한글은 낱말 단위로 줄바꿈, 첫 칸 최소 너비 */
.doc-table { width: 100%; table-layout: auto; }
.doc-table th, .doc-table td { word-break: keep-all; overflow-wrap: break-word; }
.doc-table tr > :first-child { min-width: 5.5em; }
@media (max-width: 560px) {
  .doc-table { font-size: 13px; }
  .doc-table th, .doc-table td { padding: 6px 6px; }
  .doc-table tr > :nth-child(2) { min-width: 5em; }
}
.pre-wrap { white-space: pre-wrap; }
.src-line { margin-top: 4px; }

/* 배너 플립 — 5초마다 다음 배너로 뒤집기 */
.ad-flip { position: relative; perspective: 900px; }
.chat.app > .chat-head .ad-flip { margin: 8px 0 0; }
.chat.app > .chat-head .ad-flip .ad-banner { margin: 0; }
.ad-flip .ad-banner { backface-visibility: hidden; transform-origin: 50% 50%; }
.ad-flip.rotating .ad-banner { transition: transform .6s ease, opacity .6s ease; }
/* 위로 플립: 지금 배너는 위로 굴러 올라가고, 다음 배너가 아래에서 굴러 올라온다 */
.ad-flip.rotating .ad-banner:not(.on) { position: absolute; inset: 0; transform: translateY(50%) rotateX(-90deg); opacity: 0; pointer-events: none; }
.ad-flip.rotating .ad-banner.out { transform: translateY(-50%) rotateX(90deg); opacity: 0; }
.ad-banner.house { background: linear-gradient(135deg, #0F766E, #16A34A 60%, #4ADE80); }
@media (prefers-reduced-motion: reduce) { .ad-flip.rotating .ad-banner { transition: opacity .3s; transform: none !important; } }
/* 배너 글이 줄바꿈되며 깨지지 않게 — 한 줄로, 넘치면 … */
.ad-flip .ad-banner b, .ad-flip .ad-banner > span:not(.ad-tag) { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: keep-all; }
.ad-flip .ad-banner b { padding-right: 52px; }

/* 업그레이드 버튼 — 주민·가게 모두 더보기 옆 (2026-10-07: 결제 유도) */
.top-up { display: inline-flex; align-items: center; padding: 5px 11px; font-size: 12.5px; }
.top.has-side .ai-badge { display: none; }
/* 프리미엄 가게 안내 */
.pm-tag { font-size: 10px; font-weight: 700; color: var(--p); background: var(--p-bg); border-radius: 99px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; }
.side-up { color: var(--p); font-weight: 700; }
.premium-card .pm-eyebrow { display: inline-flex; align-items: center; gap: 4px; color: var(--p); font-weight: 700; font-size: 13px; margin: 0 0 6px; }
.premium-card .pm-eyebrow .ico { width: 16px; height: 16px; }
.pm-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.pm-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; }
.pm-list .ico { flex: none; width: 20px; height: 20px; color: var(--p); margin-top: 1px; }
.pm-price { font-size: 18px; margin: 14px 0 10px; }
.btn.danger-text { color: var(--err); border-color: var(--err); }
.err-text { color: var(--err); font-size: 13px; }
.doc-table tr.warn-row td { background: color-mix(in srgb, var(--err) 8%, transparent); }
.places-map { height: 260px; }
.news-item.flash { outline: 2px solid var(--p); outline-offset: 2px; transition: outline-color .3s; }
.msg .in-link { color: var(--p); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.cam-list { display: grid; gap: 6px; margin-top: 8px; }
.cam-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.cam-row small { white-space: nowrap; }
.cam-box { margin: 2px 0 6px; }
.cam-video { width: 100%; max-height: 260px; border-radius: 10px; background: #000; display: block; }
.cam-note { display: block; margin-top: 4px; }
.help-acc { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 6px; background: var(--card); }
.help-acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; font-size: 14px; font-weight: 600; }
.help-acc > summary::-webkit-details-marker { display: none; }
.help-acc > summary small { margin-left: auto; margin-right: 8px; color: var(--muted); font-weight: 500; }
.help-acc > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; margin-top: -4px; }
.help-acc[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.help-acc > .chips { padding: 0 10px 12px; }
.map-wrap { margin-top: 8px; }
.map-btn { display: inline-flex; align-items: center; gap: 4px; }
.map-btn .ico { width: 16px; height: 16px; }
.chat-map { margin-top: 8px; height: 260px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.map-pin { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #16A34A; color: #fff; font: 700 13px/1 sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.map-legend { margin: 6px 0 0; padding-left: 22px; font-size: 13px; }
.map-legend a { color: var(--ink); }
.detail-top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: flex-end; padding: 6px 0; background: var(--bg); }
.detail-top .close-doc { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.detail-top .close-doc .ico { width: 16px; height: 16px; }
/* 대화 위 가게 시트 */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); animation: sheet-up .18s ease-out; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-bar { display: flex; justify-content: flex-end; align-items: center; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--card); }
.sheet-close { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
.sheet-close .ico { width: 16px; height: 16px; }
.sheet-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
body.sheet-open { overflow: hidden; }
/* 시트 안(iframe)에서는 머리·바닥·자체 닫기 숨김 */
body.embed > header.top, body.embed footer.foot, body.embed .detail-top, body.embed .back-ask { display: none !important; }
body.embed main.wrap { padding-top: 8px; }
/* 배너 손가락으로 넘기기 — 이전(아래로 쓸기)은 위에서 내려오고 지금 것은 아래로 */
.ad-flip.rotating { touch-action: pan-x; }
.ad-flip.rotating .ad-banner.from-top { transition: none; transform: translateY(-50%) rotateX(90deg); opacity: 0; }
.ad-flip.rotating .ad-banner.out-down { transform: translateY(50%) rotateX(-90deg); opacity: 0; }
/* 답 기다리는 중 — 점 세 개 통통 · 글 반짝임 · 단계 바뀔 때 살짝 올라옴 */
.msg.wait p { display: inline-flex; align-items: center; gap: 10px; }
.wait-dots { display: inline-flex; gap: 4px; }
.wait-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--p); opacity: .35; animation: wait-bounce 1.1s ease-in-out infinite; }
.wait-dots i:nth-child(2) { animation-delay: .15s; }
.wait-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes wait-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-6px); opacity: 1; } }
.wait-text { background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 40%, var(--p) 50%, var(--muted) 60%, var(--muted) 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: wait-shine 1.8s linear infinite; }
.wait-text.swap { animation: wait-shine 1.8s linear infinite, wait-in .35s ease-out; }
@keyframes wait-shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes wait-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wait-ai .wait-dots i { background: linear-gradient(135deg, #16A34A, #2DD4BF); }
@media (prefers-reduced-motion: reduce) { .wait-dots i, .wait-text, .wait-text.swap { animation: none; opacity: 1; color: var(--muted); background: none; } }
.thread-list li > .link { font-size: 12px; white-space: nowrap; padding: 6px 2px; }

/* 자판이 열리면(--kb, app.js) 입력칸·대화 칸을 자판 위로 — 아이폰은 자판이 화면을 덮기만 해서 (2026-10-08) */
body.chat-app .chat-input { bottom: var(--kb, 0px); }
body.chat-app .chat.app { bottom: var(--kb, 0px); }
body.chat-app .quota { bottom: calc(66px + env(safe-area-inset-bottom) + var(--kb, 0px)); }

/* 답 아래 다음 질문 버튼 (2026-10-09) */
.next-asks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.next-asks .chip { font-size: 13px; padding: 7px 12px; }

/* 카드가 하나씩 나타남 (2026-10-09) */
.card-wait { opacity: 0; transform: translateY(6px); }
.card-show { animation: typeShow .32s ease both; }
@media (prefers-reduced-motion: reduce) { .card-wait { opacity: 1; transform: none; } }

/* 관리자 목록(동네 소식·바로잡기) — 긴 출처 줄이 줄바꿈 안 돼 버튼이 카드 밖으로 밀리던 것 (2026-10-09) */
.admin-rows li { align-items: flex-start; }
.admin-rows li > span { flex: 1; min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.list.plain.admin-rows li small { white-space: normal; }
.admin-rows li > form { flex: none; }
.admin-rows li > form .btn { white-space: nowrap; }
.list.admin-rows li a.link { display: inline; padding: 0; border: 0; font-size: inherit; color: var(--p); }

/* 첫 화면 스플래시 — 마스코트 똘이 (2026-10-09). 한 세션에 한 번, splash-gate.js 가 본 적 있으면 숨김 */
.splash { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; transition: opacity .45s ease; }
.splash-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; animation: typeShow .5s ease both; }
.splash-brand img { width: 60px; height: 60px; }
.splash-brand .brand-name { font-size: 38px; }
.splash-ttori img { width: min(44vw, 200px); height: auto; animation: splashPop .7s .2s cubic-bezier(.2, .9, .3, 1.2) both; }
.splash p { margin: 0; font-size: 15px; color: var(--muted); letter-spacing: -.2px; animation: typeShow .5s .5s ease both; }
.splash p b { color: var(--ink); font-weight: 800; }
.splash.splash-out { opacity: 0; pointer-events: none; }
html.splash-seen .splash { display: none; }
@keyframes splashPop { from { opacity: 0; transform: translateY(14px) scale(.92); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .splash img, .splash p, .splash-brand { animation: none; } }
/* 네이버 지도 안의 확대 버튼·로고가 더보기 메뉴 위로 올라오던 것 — 지도 안 겹침 순서를 지도 상자 안에 가둔다 (2026-10-09) */
.store-map, .places-map, .chat-map, #bannerMap { position: relative; z-index: 0; isolation: isolate; }

/* 대화창 전구 버튼만 형광으로 — 사진(카메라) 버튼은 같은 크기 클래스를 쓰지만 제외 (2026-10-09 사용자 요청): 밝은 화면은 빨간빛, 어두운 화면은 노란빛 */
.composer-row .help-btn[data-help-open] { color: #FF1F4B; border-color: rgba(255, 31, 75, .55); box-shadow: 0 0 6px rgba(255, 31, 75, .45), inset 0 0 4px rgba(255, 31, 75, .18); animation: bulbGlowRed 2.4s ease-in-out infinite; }
.composer-row .help-btn[data-help-open] .ico { filter: drop-shadow(0 0 3px rgba(255, 31, 75, .9)); }
@keyframes bulbGlowRed { 50% { box-shadow: 0 0 12px rgba(255, 31, 75, .7), inset 0 0 6px rgba(255, 31, 75, .25); } }
:root[data-theme="dark"] .composer-row .help-btn[data-help-open] { color: #FFE81A; border-color: rgba(255, 232, 26, .55); box-shadow: 0 0 6px rgba(255, 232, 26, .45), inset 0 0 4px rgba(255, 232, 26, .15); animation-name: bulbGlowYellow; }
:root[data-theme="dark"] .composer-row .help-btn[data-help-open] .ico { filter: drop-shadow(0 0 3px rgba(255, 232, 26, .9)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .composer-row .help-btn[data-help-open] { color: #FFE81A; border-color: rgba(255, 232, 26, .55); box-shadow: 0 0 6px rgba(255, 232, 26, .45), inset 0 0 4px rgba(255, 232, 26, .15); animation-name: bulbGlowYellow; }
  :root:not([data-theme="light"]) .composer-row .help-btn[data-help-open] .ico { filter: drop-shadow(0 0 3px rgba(255, 232, 26, .9)); }
}
@keyframes bulbGlowYellow { 50% { box-shadow: 0 0 12px rgba(255, 232, 26, .75), inset 0 0 6px rgba(255, 232, 26, .22); } }
@media (prefers-reduced-motion: reduce) { .composer-row .help-btn[data-help-open] { animation: none; } }

/* 앱·홈 화면 성성AI: 두 번 눌러 확대·벌려 확대 막기 (지도 안은 지도가 직접 확대) (2026-10-09) */
html.no-zoom, html.no-zoom body { touch-action: pan-x pan-y; }
html.no-zoom .chat-map, html.no-zoom .store-map, html.no-zoom .places-map, html.no-zoom #bannerMap { touch-action: none; }

/* 관리자 경계 그리기 (2026-10-09) */
.be-card { max-width: 1100px; }
.be-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin: 10px 0; }
.be-search { display: flex; gap: 6px; flex: 1 1 260px; }
.be-search input { flex: 1; min-width: 0; }
.be-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.be-found { list-style: none; margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); max-height: 180px; overflow: auto; font-size: 13.5px; }
.be-found li { padding: 4px 0; }
.be-map { height: 68vh; min-height: 380px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); position: relative; z-index: 0; isolation: isolate; }
.be-v { background: #16A34A; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; color: #fff; font: 700 10px/1 sans-serif; cursor: grab; }
.be-v.sel { background: #FF1F4B; transform: scale(1.25); }
.be-mid { background: #fff; border: 2px solid #16A34A; border-radius: 50%; opacity: .7; cursor: copy; }
.be-save { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; margin-top: 10px; }
.be-save label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 240px; }
