/* 성성 AI — 단일 CSS. 모바일 우선, 최소 요소 · 색은 성성모두 CI (보라 #6B2CF5 · 진보라 #1A1226 · 배경 #F7F6FB) */
:root {
  --p: #6B2CF5; --p-dark: #4C1D95; --p-bg: #F3EEFF;
  --ink: #1A1226; --muted: #6B7280; --line: #E8E5F0; --bg: #F7F6FB;
  --ok: #059669; --warn: #B45309; --warn-bg: #FFFBEB; --err: #DC2626; --err-bg: #FEF2F2;
  --r: 14px;
}
* { 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: #fff; 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: #fff; 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: #fff; 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: #fff; }
.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: #fff; }
.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: #ECFDF5; 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: #fff; }
.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: #fff; }
.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: #fff; }
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: #fff; }
.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: #fff; 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: #E9DFFF; }
.coupons, .stores { list-style: none; margin: 8px 0; padding: 0; }
.coupon { display: flex; align-items: center; gap: 10px; background: #fff; 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: #fff; 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: #fff; 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: #ECFDF5; 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: #fff; }
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: #fff; 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: #fff; 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: #fff; }
.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: #fff; 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: #fff; 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: #ECFDF5; color: var(--ok); font-weight: 700; }
.tag.closed { background: #F3F4F6; 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: #fff; 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: #fff; 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: 14px 0 4px; padding: 14px 16px 14px;
  border-radius: var(--r); background: linear-gradient(135deg, #4C1D95, #6B2CF5); 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: #fff; }
.plan-box b { font-size: 14px; }
.plan-box.paid { background: #ECFDF5; 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: #EEE; }
.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: #FCFBFF; }
.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: #ECFDF5; 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: #FAFAFC; 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: #fff; 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, #4C1D95, #6B2CF5); color: #fff; border-radius: var(--r); padding: 14px 16px; margin: 12px 0; }
.rank-box .muted { color: #E9DFFF; }
.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: #fff; 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: #fff; 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: #FAFAFC; }
.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: #fff; 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: #fff; 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: #fff; 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: #F1F0F5; 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: #fff; 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: #FBFAFE; }
.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: #F1F0F5; 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: #fff; 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: #fff; 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); }
