/* 오늘가게 — 밝은 식당 톤. 주황(--accent)은 길찾기·쿠폰 같은 '행동' 버튼에만 쓴다. */
:root {
  --bg: #fffaf3;
  --bg2: #f6eee3;
  --fg: #221c17;
  --sub: #8a7f74;
  --line: rgba(34, 28, 23, .1);
  --accent: #e2572b;
  --accent-fg: #fff;
  --deal: #fff0e6;
  --deal-fg: #b8401a;
  --open: #2f8a4e;
  --closed: #9a8f84;
  --glass: rgba(255, 250, 243, .86);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15120f; --bg2: #201b17; --fg: #f4ede4; --sub: #a0958a; --line: rgba(244, 237, 228, .1);
  --accent: #f06a3d; --deal: #3a2219; --deal-fg: #ffb08f; --open: #5fc07d; --closed: #7d736a; --glass: rgba(21, 18, 15, .82);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--fg); }
body { font-family: Pretendard, -apple-system, system-ui, sans-serif; font-size: 14px; letter-spacing: -0.2px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--fg); background: var(--bg2); border: 1px solid transparent; border-radius: 10px; padding: 11px 12px; width: 100%; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--sub); }
svg { display: block; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.topbar { position: sticky; top: 0; z-index: 20; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.logo { font-size: 20px; font-weight: 800; letter-spacing: -0.6px; }
.logo::first-letter { color: var(--accent); }
.top-actions { display: flex; gap: 14px; }
.icon-btn svg, .tabbar svg { width: 24px; height: 24px; }
#view { padding-bottom: 76px; }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 60px; display: flex; justify-content: space-around; align-items: center; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { padding: 10px; opacity: .4; }
.tabbar a.on { opacity: 1; color: var(--accent); }

/* 맨 위: 오늘 혜택 있는 가게 */
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 14px 16px 10px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: 0 0 auto; width: 66px; text-align: center; font-size: 11.5px; color: var(--sub); }
.story .ring { width: 66px; height: 66px; border-radius: 50%; padding: 2.5px; background: var(--accent); }
.story .av { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--bg); background-size: cover; background-position: center; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px; }
.story span { display: block; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 7px 13px; border-radius: 99px; background: var(--bg2); font-weight: 600; font-size: 13px; color: var(--sub); }
.chip.on { background: var(--fg); color: var(--bg); }
.chip.region { border: 1px solid var(--line); background: none; color: var(--fg); }
.chip.region.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* 게시물 */
.post { border-bottom: 8px solid var(--bg2); padding-bottom: 14px; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px; flex: 0 0 auto; }
.post-head .who { flex: 1; min-width: 0; }
.post-head .who b { font-weight: 700; font-size: 15px; }
.post-head .who small { display: block; color: var(--sub); font-size: 12px; margin-top: 1px; }
.state { font-size: 12px; font-weight: 700; white-space: nowrap; }
.state.open { color: var(--open); }
.state.closed { color: var(--closed); }
.ad-mark { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--sub); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-right: 3px; }
.media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg2); }
.slides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; display: grid; place-items: center; text-align: center; color: #fff; padding: 28px; position: relative; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide .ph-name { font-size: 30px; font-weight: 800; line-height: 1.25; word-break: keep-all; text-shadow: 0 2px 12px rgba(0,0,0,.25); }
.slide .ph-sub { margin-top: 8px; font-size: 13px; opacity: .85; font-weight: 600; }
.price-tag { position: absolute; left: 12px; bottom: 12px; padding: 7px 12px; border-radius: 10px; background: rgba(20, 16, 13, .72); color: #fff; font-weight: 700; font-size: 14px; backdrop-filter: blur(8px); }
.dots { display: flex; gap: 5px; justify-content: center; padding-top: 10px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--accent); }

.menu-line { padding: 12px 16px 0; display: flex; align-items: baseline; gap: 8px; }
.menu-line b { font-size: 17px; font-weight: 800; }
.menu-line span { color: var(--sub); font-size: 13px; }
.deal { margin: 10px 16px 0; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--deal); color: var(--deal-fg); }
.deal svg { width: 20px; height: 20px; flex: 0 0 auto; }
.deal .txt { flex: 1; min-width: 0; font-weight: 700; font-size: 13.5px; }
.deal .txt small { display: block; font-weight: 500; font-size: 11.5px; opacity: .8; margin-top: 1px; }
.deal button { flex: 0 0 auto; padding: 7px 11px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); font-weight: 700; font-size: 12.5px; }
.deal button.got { background: none; color: var(--deal-fg); border: 1px solid currentColor; }

.go-bar { display: flex; gap: 6px; padding: 12px 16px 0; }
.go-bar button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; border-radius: 12px; background: var(--bg2); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.go-bar button.main { background: var(--accent); color: var(--accent-fg); flex: 1.3; }
.go-bar svg { width: 17px; height: 17px; flex: 0 0 auto; }

.actions { display: flex; align-items: center; gap: 16px; padding: 12px 16px 2px; }
.actions .sp { flex: 1; }
.actions svg { width: 25px; height: 25px; }
.actions .liked svg { fill: var(--accent); stroke: var(--accent); }
.actions .saved svg { fill: currentColor; }
.likes { padding: 2px 16px 0; font-weight: 700; font-size: 13px; }
.caption { padding: 5px 16px 0; line-height: 1.6; word-break: keep-all; }
.caption b { font-weight: 700; margin-right: 5px; }
.caption .tag { color: var(--accent); }
.cmt-link { display: block; padding: 4px 16px 0; color: var(--sub); font-size: 13px; cursor: pointer; }
.notice { padding: 6px 16px 0; color: var(--sub); font-size: 11.5px; line-height: 1.5; }
.time { padding: 6px 16px 0; color: var(--sub); font-size: 11.5px; }

/* 탐색 */
.search-wrap { padding: 12px 16px 2px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.cell { position: relative; aspect-ratio: 1; overflow: hidden; display: grid; place-items: center; color: #fff; text-align: center; padding: 8px; font-weight: 800; font-size: 14px; word-break: keep-all; }
.cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cell .cp { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 7px 6px; font-size: 11px; font-weight: 600; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.cell .cd { position: absolute; right: 6px; top: 6px; padding: 2px 6px; border-radius: 6px; background: var(--accent); font-size: 10.5px; font-weight: 700; }
.toggles { display: flex; gap: 14px; padding: 0 16px 10px; }
.toggles label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.toggles input { width: 17px; height: 17px; accent-color: var(--accent); }
.empty { padding: 70px 24px; text-align: center; color: var(--sub); line-height: 1.6; }
.empty b { display: block; font-size: 20px; color: var(--fg); margin-bottom: 6px; }

/* 세로 보기 */
.reels { height: calc(100vh - 114px); overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; background: #000; }
.reels::-webkit-scrollbar { display: none; }
.reel { position: relative; height: 100%; scroll-snap-align: start; display: grid; place-items: center; color: #fff; text-align: center; overflow: hidden; }
.reel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0,0,0,.82)); pointer-events: none; }
.reel .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel .center { position: relative; font-size: 34px; font-weight: 800; padding: 30px; word-break: keep-all; }
.reel .info { position: absolute; left: 16px; right: 72px; bottom: 20px; text-align: left; z-index: 2; }
.reel .info b { font-size: 16px; }
.reel .info p { margin-top: 5px; line-height: 1.5; font-size: 13px; opacity: .92; }
.reel .info .go { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 11px 16px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; }
.reel .info .go svg { width: 17px; height: 17px; }
.reel .side { position: absolute; right: 12px; bottom: 34px; display: flex; flex-direction: column; gap: 20px; align-items: center; font-size: 11.5px; z-index: 2; color: #fff; }
.reel .side svg { width: 28px; height: 28px; margin: 0 auto 4px; }
.reel .side .liked svg { fill: var(--accent); stroke: var(--accent); }

/* 입력 화면 */
.form { padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.form h2 { font-size: 22px; font-weight: 800; }
.form h3 { font-size: 15px; font-weight: 800; margin-top: 8px; }
.form label { font-weight: 700; font-size: 12.5px; color: var(--sub); display: flex; flex-direction: column; gap: 6px; }
.form .hint { font-weight: 500; color: var(--sub); font-size: 12px; line-height: 1.5; }
.form .row { display: flex; gap: 10px; }
.form .row > * { flex: 1; min-width: 0; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { flex-direction: row; align-items: center; gap: 4px; color: var(--fg); font-weight: 600; }
.days input { width: 16px; height: 16px; accent-color: var(--accent); }
.drop { border: 1.5px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center; color: var(--sub); font-size: 12.5px; cursor: pointer; line-height: 1.6; }
.drop b { display: block; color: var(--fg); font-size: 14px; }
.thumbs { display: flex; gap: 6px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.link-row { display: flex; gap: 6px; }
.link-row select { flex: 0 0 120px; }
.primary { height: 50px; border-radius: 12px; background: var(--accent); color: var(--accent-fg); font-weight: 800; font-size: 15px; }
.primary:disabled { opacity: .5; }
.ghost { height: 44px; border-radius: 12px; background: var(--bg2); font-weight: 700; }
.link-btn { color: var(--sub); font-size: 13px; text-decoration: underline; text-align: center; }
.err { color: var(--accent); font-size: 12.5px; font-weight: 600; }

/* 가게·프로필 */
.store-top { display: flex; align-items: center; gap: 16px; padding: 20px 16px 12px; }
.store-top .avatar { width: 76px; height: 76px; border-radius: 22px; font-size: 30px; }
.stats { flex: 1; display: flex; justify-content: space-around; text-align: center; }
.stats b { display: block; font-size: 19px; font-weight: 800; }
.stats span { font-size: 11.5px; color: var(--sub); }
.store-name { padding: 0 16px; font-size: 17px; font-weight: 800; }
.store-info { padding: 8px 16px 0; color: var(--sub); font-size: 13px; line-height: 1.7; }
.store-info b { color: var(--fg); font-weight: 600; }
.store-btns { display: flex; gap: 6px; padding: 14px 16px; }
.store-btns > * { flex: 1; text-align: center; padding: 10px; border-radius: 10px; background: var(--bg2); font-weight: 700; font-size: 13px; }
.store-btns .on { background: var(--accent); color: var(--accent-fg); }
.menu-list { list-style: none; padding: 4px 16px 10px; }
.menu-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.menu-list li span { color: var(--sub); }
.section-title { padding: 18px 16px 8px; font-weight: 800; font-size: 15px; }

/* 쿠폰 */
.coupon { margin: 10px 16px; padding: 14px; border-radius: 14px; background: var(--deal); color: var(--deal-fg); display: flex; gap: 12px; align-items: center; }
.coupon .txt { flex: 1; }
.coupon .txt b { display: block; font-size: 15px; }
.coupon .txt small { opacity: .85; }
.coupon.used { opacity: .5; }
.coupon button { padding: 9px 12px; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 700; }
.big-code { text-align: center; padding: 10px 0 4px; }
.big-code b { display: block; font-size: 38px; font-weight: 900; letter-spacing: 6px; color: var(--accent); }

/* 사장님 화면 */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 6px 16px; }
.kpi { padding: 14px; border-radius: 14px; background: var(--bg2); }
.kpi b { display: block; font-size: 22px; font-weight: 800; }
.kpi span { font-size: 12px; color: var(--sub); }
.table { width: calc(100% - 32px); margin: 6px 16px; border-collapse: collapse; font-size: 12.5px; }
.table th, .table td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.table th:first-child, .table td:first-child { text-align: left; }
.table th { color: var(--sub); font-weight: 600; }
.card { margin: 10px 16px; padding: 14px; border-radius: 14px; background: var(--bg2); line-height: 1.6; }
.card b { font-size: 15px; }
.card small { color: var(--sub); display: block; }
.card .btn-row { display: flex; gap: 6px; margin-top: 10px; }
.card .btn-row button, .card .btn-row a { flex: 1; text-align: center; padding: 9px; border-radius: 9px; background: var(--bg); font-weight: 700; font-size: 13px; }
.card .btn-row .on { background: var(--accent); color: #fff; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.list-row svg { width: 20px; height: 20px; color: var(--sub); }
.list-row span { flex: 1; }

/* 첫 화면(게시물 없을 때) */
.welcome { padding: 20px 16px 30px; text-align: center; line-height: 1.6; color: var(--sub); }
.welcome-pic { aspect-ratio: 4 / 3; border-radius: 18px; margin-bottom: 18px; background: url('img/hero.jpg') center/cover, var(--bg2); }
.welcome b { display: block; font-size: 20px; color: var(--fg); margin-bottom: 6px; }
.welcome .primary { display: flex; align-items: center; justify-content: center; margin-top: 18px; }

/* 시트·토스트 */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet.hidden, .toast.hidden { display: none; }
.panel { width: 100%; max-width: 480px; max-height: 82vh; overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding: 8px 0 24px; }
.grab { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 6px auto 10px; }
.panel h3 { padding: 4px 16px 10px; font-size: 16px; font-weight: 800; }
.panel .opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left; font-weight: 600; font-size: 14.5px; }
.panel .opt svg { width: 20px; height: 20px; }
.cmt { display: flex; gap: 10px; padding: 9px 16px; line-height: 1.5; }
.cmt .avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.cmt b { margin-right: 5px; }
.cmt-form { display: flex; gap: 8px; padding: 10px 16px 0; }
.cmt-form button { flex: 0 0 auto; padding: 0 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 82px; transform: translateX(-50%); z-index: 60; padding: 11px 18px; border-radius: 12px; background: var(--fg); color: var(--bg); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.back-bar { display: flex; align-items: center; gap: 6px; padding: 12px 12px 0; font-weight: 700; }
.back-bar svg { width: 22px; height: 22px; }

/* 약관 */
.page { padding: 20px 16px 30px; }
.page h2 { font-size: 22px; font-weight: 800; }
.legal .meta { color: var(--sub); font-size: 12px; margin: 4px 0 16px; }
.legal h3 { font-size: 14.5px; font-weight: 800; margin: 22px 0 8px; }
.legal p, .legal li { line-height: 1.75; font-size: 13.5px; word-break: keep-all; }
.legal ol, .legal ul { padding-left: 18px; margin: 4px 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; line-height: 1.55; word-break: keep-all; }
.check { flex-direction: row !important; align-items: flex-start; gap: 8px !important; color: var(--fg) !important; font-weight: 600 !important; line-height: 1.5; }
.check input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--accent); }
.check a { text-decoration: underline; }
.social { height: 46px; border-radius: 12px; font-weight: 700; }
.social.kakao { background: #fee500; color: #191919; }
.social.apple { background: #000; color: #fff; }
:root[data-theme="dark"] .social.apple { background: #fff; color: #000; }
.avatar, .store-top .avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* 내 정보(프로필) */
.me-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 4px; }
.me-head b { font-size: 18px; font-weight: 800; }
.me-head .icon-btn svg { width: 24px; height: 24px; }
.me-top { display: flex; align-items: center; gap: 14px; padding: 14px 16px 6px; }
.avatar.big { width: 64px; height: 64px; border-radius: 50%; font-size: 26px; }
.me-info { flex: 1; min-width: 0; }
.me-info b { display: block; font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-info small { color: var(--sub); font-size: 12.5px; }
.pill { flex: 0 0 auto; padding: 8px 14px; border-radius: 99px; background: var(--bg2); font-weight: 700; font-size: 13px; }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 10px 16px 4px; border-radius: 14px; background: var(--bg2); }
.me-stats a { padding: 12px 4px; text-align: center; }
.me-stats b { display: block; font-size: 18px; font-weight: 800; }
.me-stats span { font-size: 11.5px; color: var(--sub); }
.tabs { display: flex; margin-top: 12px; border-bottom: 1px solid var(--line); }
.tabs a { flex: 1; text-align: center; padding: 12px 0; font-weight: 700; font-size: 14px; color: var(--sub); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--fg); border-bottom-color: var(--fg); }
.list-row small { color: var(--sub); font-weight: 500; }
.list-row > svg:last-child { width: 18px; height: 18px; color: var(--sub); }
.empty.small { padding: 36px 24px; font-size: 13.5px; }
.empty.small b { display: inline; font-size: inherit; margin: 0; }
.owner-card { display: flex; align-items: center; gap: 12px; margin: 22px 16px 10px; padding: 16px; border-radius: 16px; background: var(--deal); color: var(--deal-fg); }
.owner-card div { flex: 1; }
.owner-card b { display: block; font-size: 15px; font-weight: 800; }
.owner-card small { font-size: 12.5px; opacity: .85; line-height: 1.5; }
.owner-card svg { width: 20px; height: 20px; }
.me-edit { display: flex; align-items: center; gap: 12px; }
.me-edit small { color: var(--sub); font-size: 12px; line-height: 1.5; }
.field-hint { display: flex; justify-content: space-between; gap: 10px; margin-top: -6px; color: var(--sub); font-size: 12px; }

/* 설정 */
.set-group { padding: 18px 16px 6px; font-size: 12.5px; font-weight: 700; color: var(--sub); }
.set-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left; font-weight: 600; font-size: 15px; }
.set-row > svg:first-child { width: 20px; height: 20px; color: var(--sub); }
.set-row > svg:last-child { width: 16px; height: 16px; color: var(--sub); }
.set-row span { flex: 1; }
.set-row small { display: block; color: var(--sub); font-weight: 500; font-size: 12px; margin-top: 2px; }
.set-row.danger { color: var(--accent); margin-top: 12px; }
.set-row.danger svg { color: var(--accent); }
