:root {
  --primary: #0b6e4f; --primary-2: #e6f4ee; --text: #1b1f23; --muted: #6b7280; --line: #e5e7eb; --bg: #fff;
  --ok: #10b981; --busy: #9ca3af; --block: #f59e0b; --sea: #1d6fe0; --indoor: #8a4fd8;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; color: var(--text); background: var(--bg); -webkit-tap-highlight-color: transparent; }
body { display: flex; flex-direction: column; overflow: hidden; }
button, input, select { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; }
.gap { gap: 8px; } .gap > * { flex: 1; }

.topbar { padding: 8px 12px 6px; padding-top: max(8px, env(safe-area-inset-top)); background: #fff; border-bottom: 1px solid var(--line); z-index: 20; }
.search { display: flex; gap: 6px; }
.search input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.filters { display: flex; gap: 6px; margin-top: 6px; overflow-x: auto; scrollbar-width: none; }
.filters select { height: 32px; border: 1px solid var(--line); border-radius: 16px; padding: 0 8px; background: #fff; flex-shrink: 0; max-width: 130px; }

.btn { height: 40px; border: 0; border-radius: 10px; padding: 0 14px; cursor: pointer; font-weight: 600; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.ghost { background: #f3f4f6; color: var(--text); }
.btn.danger { background: #fee2e2; color: #b91c1c; }
.btn.block { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0 4px; font-size: 13px; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: #f3f4f6; cursor: pointer; font-size: 18px; flex-shrink: 0; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.chip { height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 0 12px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.chip small { color: var(--muted); font-size: 11px; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.on small { color: #d1fae5; }

#map-wrap { position: relative; flex: 1; min-height: 0; isolation: isolate; z-index: 0; }
#map { position: absolute; inset: 0; }

.seat-bar { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 1000; background: rgba(255,255,255,.96); border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.15); padding: 8px; display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.seat-bar input[type=date] { flex: 1; height: 32px; margin: 0 6px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; }
.legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.dot.available { background: var(--ok); } .dot.reserved { background: var(--busy); } .dot.blocked { background: var(--block); }

.hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1000; background: rgba(17,24,39,.85); color: #fff; border-radius: 20px; padding: 6px 6px 6px 14px; font-size: 13px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.fabs { position: absolute; right: 10px; bottom: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.fab { min-width: 64px; height: 40px; border: 0; border-radius: 20px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); font-weight: 700; cursor: pointer; }
.fab.on { background: var(--primary); color: #fff; }

/* 좌석 마커 */
.seat { min-width: 26px; height: 26px; padding: 0 5px; border-radius: 13px; border: 2px solid #fff; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; white-space: nowrap; transform: translate(-50%, -50%); user-select: none; touch-action: none; }
.leaflet-marker-icon .seat, .leaflet-div-icon .seat { transform: translate(-50%, -50%); }
.seat.available { background: var(--ok); }
.seat.reserved { background: var(--busy); }
.seat.blocked { background: var(--block); }
.seat.unknown, .seat.owner { background: #2563eb; }
.seat.inactive { background: #d1d5db; color: #6b7280; }
.seat.t-좌대 { border-radius: 6px; }
.seat.t-방갈로 { border-radius: 4px; height: 30px; }
.seat.sel { outline: 3px solid #f43f5e; }
/* Kakao CustomOverlay 는 자체 앵커를 쓰므로 transform 제거 */
.kakao .seat { transform: none; }

/* 바텀시트 */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.18); transform: translateY(100%); transition: transform .25s, max-height .25s; max-height: 55vh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.sheet.open { transform: translateY(0); }
.sheet.full { max-height: 88vh; }
.sheet-handle { height: 22px; flex-shrink: 0; cursor: pointer; position: relative; }
.sheet-handle::after { content: ''; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: #d1d5db; }
#sheet-body, #panel-body { overflow-y: auto; padding: 0 16px 16px; }
#sheet-body h3 { margin: 4px 0 8px; font-size: 18px; }
#sheet-body h4 { margin: 14px 0 6px; font-size: 15px; }
.spot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }

.tag { display: inline-block; font-size: 11px; border-radius: 6px; padding: 2px 6px; background: var(--primary-2); color: var(--primary); vertical-align: middle; font-weight: 600; }
.tag.바다 { background: #e0edff; color: var(--sea); } .tag.실내 { background: #f1e8ff; color: var(--indoor); } .tag.gray { background: #f3f4f6; color: var(--muted); }
.tag.st-cancelled, .tag.st-no_show { background: #f3f4f6; color: var(--muted); }

.spot-list, .resv-list, .session-list { list-style: none; margin: 0; padding: 0; }
.spot-item { padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.spot-item .name, .resv-list .name { font-weight: 700; margin-bottom: 2px; }
.session-list li { padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 8px; }
.session-list li b { margin-left: auto; }
.resv-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.resv-list li.cancelled { opacity: .55; }
.resv-list .btn { margin-top: 6px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 10px; font-size: 13px; }
.info-grid span { display: block; color: var(--muted); font-size: 11px; }
dl.confirm { display: grid; grid-template-columns: 70px 1fr; gap: 8px; margin: 8px 0 16px; }
dl.confirm dt { color: var(--muted); } dl.confirm dd { margin: 0; }
dl.confirm select { height: 32px; border-radius: 8px; border: 1px solid var(--line); padding: 0 8px; }

.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 18px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.modal h3 { margin: 0; }
.modal input, .form input, .form select { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; width: 100%; }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: rgba(17,24,39,.92); color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 60; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 업주 */
.owner-panel { position: absolute; left: 8px; top: 8px; z-index: 1000; background: rgba(255,255,255,.97); border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.15); padding: 10px; width: min(360px, calc(100% - 16px)); max-height: calc(100% - 16px); display: flex; flex-direction: column; }
#panel-body { padding: 0; }
.form { display: grid; grid-template-columns: 80px 1fr; gap: 6px 8px; align-items: center; font-size: 14px; margin: 8px 0; }
.mode-on { background: #f43f5e !important; color: #fff !important; }
table.mini { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
table.mini td, table.mini th { border-bottom: 1px solid var(--line); padding: 4px; text-align: left; }

/* 지도 레벨별 좌석 마커: 1=번호 전체, 2=숫자만, 3=점 */
.seat .short { display: none; }
#map-wrap[data-lv="2"] .seat { min-width: 20px; height: 20px; font-size: 10px; padding: 0 3px; }
#map-wrap[data-lv="2"] .seat .full { display: none; }
#map-wrap[data-lv="2"] .seat .short { display: inline; }
#map-wrap[data-lv="3"] .seat { min-width: 12px; width: 12px; height: 12px; padding: 0; border-width: 1.5px; }
#map-wrap[data-lv="3"] .seat span { display: none; }
.owner-panel.collapsed #panel-body { display: none; }
