/* 예약 매장 운영 시연 — 오늘 예약표·예약 넣기·회원권·손님 메시지 + 오늘 마감 카톡 보고.
   앞부분은 4개 시연이 같이 쓰는 바탕(색·입력 칸·단추·안내)이고, 강조색만 시연마다 다르다. 클래스에 ce- 접두사는 쓰지 않는다. */

:root {
  --canvas: #eef1f5;
  --surface: #ffffff;
  --sunken: #f6f8fa;
  --ink: #172033;
  --ink-2: #3a4457;
  --muted: #5e6878;
  --line: #dce1e8;
  --line-2: #ebeef3;
  --accent: #b0306a;
  --accent-deep: #8f2455;
  --accent-soft: #fbe9f1;
  --accent-edge: #f1c9dc;
  --accent-text: #5c1636;
  --accent-ring: rgba(176,48,106,.45);
  --bad: #c8281c;
  --bad-bg: #fde8e6;
  --warn: #9a5706;
  --warn-bg: #fef1d6;
  --ok: #0b7a47;
  --ok-bg: #ddf5e7;
  --kakao: #fee500;
  --chat: #bacbdc;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 7px;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 14px/1.5 var(--font);
  letter-spacing: -0.01em;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── 앱 머리 ───────────────────────────── */
.app-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px clamp(14px, 2.4vw, 28px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 15px;
}
.brand-mark i { display: block; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 3px; transform: rotate(45deg); }
.brand strong { display: block; font-size: 15px; font-weight: 750; line-height: 1.2; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.app-title { font-size: 15px; font-weight: 650; color: var(--ink-2); padding-left: 14px; border-left: 1px solid var(--line); }
.app-date { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* 처음 보는 사람을 위한 한 줄 안내 */
.guide {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 14px clamp(14px, 2.4vw, 28px) 0;
  padding: 10px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-edge);
  border-radius: var(--r-md);
  color: var(--accent-text);
  font-size: 13.5px;
}
.guide b { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; }
.guide button { margin-left: auto; flex: none; border: 0; background: none; color: var(--accent-text); font-size: 12.5px; text-decoration: underline; padding: 2px 4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.panel-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 14px 16px 10px; }
.panel-head h2 { font-size: 16px; font-weight: 750; }
.panel-head p { font-size: 12.5px; color: var(--muted); }

/* ── 입력 칸 ───────────────────────────── */
.field { display: grid; gap: 4px; min-width: 0; }
.field > span, .field legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0; }
.field select, .field input, .field textarea {
  height: 40px; padding: 0 10px; min-width: 0; width: 100%;
  border: 1px solid #cbd2dc; border-radius: var(--r-sm); background: #fff;
}
.field textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.field input[type="number"] { font-variant-numeric: tabular-nums; }
.field select:focus-visible, .field input:focus-visible, .field textarea:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field [aria-invalid="true"] { border-color: var(--bad); background: #fff8f7; }
.form-msg { font-size: 12.5px; }
.form-msg:empty { display: none; }
.form-msg.is-error { color: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 700; font-size: 14px; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: #fff; border-color: #cbd2dc; color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

/* 처음 사용자 강조: 눌러 볼 곳에 링 */
.coach-ring { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--accent-ring); animation: ring 1.6s ease-in-out infinite; }
@keyframes ring { 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 10px transparent; } }

@media (max-width: 680px) {
  .app-title { display: none; }
  .guide { flex-wrap: wrap; }
}
@media (max-width: 420px) { .app-date { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}


/* ══ 이 시연 ═══════════════════════════════ */
.app-head .close-day { margin-left: 4px; height: 38px; }
.brand-mark { background: var(--accent); }

/* 오늘 요약 띠 */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px clamp(14px, 2.4vw, 28px) 0; padding: 0; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.stats li { padding: 11px 16px; border-left: 1px solid var(--line-2); min-width: 0; }
.stats li:first-child { border-left: 0; }
.stats span { display: block; font-size: 12.5px; color: var(--muted); }
.stats strong { display: block; font-size: 23px; font-weight: 750; line-height: 1.25; }
.stats small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stats .is-bad strong { color: var(--bad); }
.stats strong.bump { animation: bump .5s ease-out; }
@keyframes bump { 40% { color: var(--accent); transform: translateY(-2px); } }

/* 휴대폰에서만 쓰는 탭 */
.tabbar { display: none; }

.board {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px; padding: 16px clamp(14px, 2.4vw, 28px) 28px; align-items: start;
}
.panel-head .head-btn { margin-left: auto; align-self: center; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; }

/* 오늘 예약표 */
.day-list { list-style: none; margin: 0; padding: 0 8px 10px; max-height: 440px; overflow-y: auto; }
.slot-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 8px; border-top: 1px solid var(--line-2); }
.slot-row:first-child { border-top: 0; }
.slot-row time { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.slot-row .who { min-width: 0; font-size: 14px; }
.slot-row .who b { font-weight: 700; }
.slot-row .sub { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.slot-row.is-done time, .slot-row.is-done .who { color: var(--muted); }
.slot-row.is-noshow .who b { text-decoration: line-through; text-decoration-color: var(--bad); }
.src, .pass-chip, .ns-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; line-height: 18px; background: var(--line-2); color: var(--ink-2); }
.src.naver { background: #dcf5e3; color: #0a6b35; }
.src.kakao { background: #fff4b8; color: #5c4a00; }
.src.phone { background: #e7eefc; color: #2c4fa8; }
.pass-chip { background: var(--accent-soft); color: var(--accent-deep); font-weight: 650; }
.pass-chip.low { background: var(--warn-bg); color: var(--warn); }
.ns-chip { background: var(--bad-bg); color: var(--bad); }
.acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; max-width: 220px; }
.act-note { display: block; width: 100%; text-align: right; font-size: 11.5px; color: var(--muted); }
.slot-row.is-new { animation: newRow 1.8s ease-out; border-radius: 8px; }
@keyframes newRow { 0% { background: #ffd9ea; transform: translateY(-6px); opacity: 0; } 15% { opacity: 1; transform: none; } 100% { background: transparent; } }

/* 예약 넣기 */
.resv { padding: 0 16px 16px; display: grid; gap: 12px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.days button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 0; display: grid; gap: 0; line-height: 1.3; }
.days button small { font-size: 11.5px; color: var(--muted); }
.days button b { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }
.days button.sun small, .days button.sun b { color: var(--bad); }
.days button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.days button[aria-pressed="true"] small, .days button[aria-pressed="true"] b { color: #fff; }
.slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.slots button { height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.slots button:hover:not(:disabled) { border-color: var(--accent); }
.slots button:disabled { background: var(--sunken); color: #9aa2ae; text-decoration: line-through; cursor: not-allowed; border-style: dashed; }
.slots button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.slots .closed { grid-column: 1 / -1; padding: 10px; text-align: center; color: var(--muted); background: var(--sunken); border-radius: 8px; font-size: 13px; }
.resv-form { display: grid; gap: 10px; }
.resv-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.8fr); gap: 10px; }
.confirm { border-radius: var(--r-md); background: var(--chat); padding: 10px 12px 12px; }
.confirm-cap { font-size: 11.5px; color: #33404f; margin-bottom: 6px; }
.confirm.is-new .atalk { animation: pop .45s cubic-bezier(.2,.8,.2,1.2); }
@keyframes pop { from { transform: translateY(8px) scale(.97); opacity: 0; } }
.pf { width: 32px; height: 32px; border-radius: 12px; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='6' cy='14.5' r='2.6' fill='none' stroke='%23fff' stroke-width='1.8'/%3E%3Ccircle cx='14' cy='14.5' r='2.6' fill='none' stroke='%23fff' stroke-width='1.8'/%3E%3Cpath d='M7.6 12.6L14.5 3.5M12.4 12.6L5.5 3.5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / 20px no-repeat; flex: none; }
.pf.small { width: 22px; height: 22px; border-radius: 8px; background-size: 15px; }
.bubble-name { font-size: 11.5px; color: #33404f; margin-bottom: 3px; }
.bubble { background: #fff; border-radius: 4px 12px 12px 12px; padding: 10px 12px; font-size: 13px; line-height: 1.6; white-space: pre-line; }

/* 알림톡 모양 미리보기 */
.atalk { max-width: 340px; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(23, 32, 51, .1); }
.atalk-top { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: var(--kakao); font-size: 12.5px; font-weight: 800; color: #2a2300; }
.atalk-top small { font-weight: 600; font-size: 11px; color: #5c4a00; }
.atalk-body { padding: 10px 12px 12px; font-size: 13px; line-height: 1.6; }
.atalk-body b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.atalk-body p { white-space: pre-line; color: var(--ink-2); }
.atalk-btn { display: block; margin-top: 10px; padding: 7px 0; text-align: center; border-radius: 6px; background: var(--sunken); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--ink-2); }

/* 회원권 */
.reg-filter, .msg-kinds { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.chip { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid #cbd2dc; background: #fff; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .cnt { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 11.5px; line-height: 18px; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .cnt { background: rgba(255,255,255,.22); color: #fff; }
.table-wrap { overflow-x: auto; margin: 0 16px; border: 1px solid var(--line-2); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
thead th { background: var(--sunken); font-size: 12px; font-weight: 650; color: var(--muted); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tbody th { font-weight: 650; }
td.low { color: var(--warn); font-weight: 700; }
td.ns { color: var(--bad); font-weight: 650; }
.away { color: var(--bad); font-weight: 650; }
tr.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 30% { background: #ffe3ef; } 100% { background: transparent; } }
.reg-note { margin: 10px 16px 14px; font-size: 12.5px; color: var(--muted); }
.reg-note:empty { display: none; }

/* 손님 메시지 */
.msg-rule { margin: 0 16px 10px; font-size: 12.5px; color: var(--muted); }
.msg-wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 12px; padding: 0 16px 16px; align-items: start; }
.msg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.msg-item { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; align-items: center; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.msg-item b { font-weight: 700; font-size: 13.5px; }
.msg-item .sub { grid-column: 1; font-size: 12px; color: var(--muted); }
.msg-item .badge { grid-column: 2; grid-row: 1 / span 2; font-size: 11.5px; }
.msg-item[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.msg-list .empty { padding: 12px; text-align: center; color: var(--muted); background: var(--sunken); border-radius: 10px; font-size: 13px; }
.msg-preview { border-radius: var(--r-md); background: var(--chat); padding: 10px 12px 12px; min-height: 120px; }
.msg-preview:empty { display: none; }
.pv-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pv-acts .btn-ghost { background: rgba(255,255,255,.85); }

/* 알림 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 50; max-width: min(92vw, 420px);
  padding: 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600;
  transform: translate(-50%, 16px); opacity: 0; transition: transform .25s, opacity .25s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast:empty { display: none; }

/* 마감 보고: 카톡 대화창 */
.report { padding: 0; border: 0; background: transparent; width: min(400px, calc(100vw - 24px)); max-height: min(720px, calc(100vh - 24px)); overflow: visible; }
.report::backdrop { background: rgba(15, 20, 30, .55); }
.phone-chat { display: flex; flex-direction: column; max-height: min(720px, calc(100vh - 24px)); border-radius: 24px; overflow: hidden; background: var(--chat); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); border: 6px solid #1c2230; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 14px; background: #a9bdd1; }
.chat-head h2 { font-size: 15px; font-weight: 750; }
.chat-sub { font-size: 11.5px; color: #3f4c5c; }
.chat-head .x { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.55); font-size: 20px; line-height: 1; }
.chat-head .pf.small { width: 28px; height: 28px; border-radius: 10px; background-size: 18px; }
.chat-body { padding: 14px 12px 18px; display: grid; gap: 10px; overflow-y: auto; align-content: start; }
.day-sep { justify-self: center; font-size: 11.5px; color: #fff; background: rgba(40, 55, 75, .35); padding: 2px 12px; border-radius: 999px; }
.cmsg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; animation: pop .4s cubic-bezier(.2,.8,.2,1.2); }
.cmsg .stack { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.cmsg .bubble { max-width: 290px; }
.cmsg .card { background: #fff; border-radius: 4px 12px 12px 12px; overflow: hidden; width: min(290px, 100%); font-size: 13px; }
.cmsg .card h3 { background: var(--kakao); padding: 8px 12px; font-size: 13px; font-weight: 800; color: #2a2300; }
.cmsg .card dl { margin: 0; padding: 8px 12px 10px; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.cmsg .card dt { color: var(--muted); }
.cmsg .card dd { margin: 0; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.cmsg .card dd.big { font-size: 17px; font-weight: 800; }
.cmsg .card ul { margin: 0; padding: 0 12px 10px 28px; }
.cmsg .card h3 + ul { padding-top: 8px; }
.cmsg .card li { margin: 2px 0; }
.cmsg .card .bad { color: var(--bad); font-weight: 700; }
.cmsg .time { font-size: 10.5px; color: #4a5868; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; background: #fff; border-radius: 4px 12px 12px 12px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #9aa5b3; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }

@media (max-width: 1080px) {
  .msg-wrap { grid-template-columns: minmax(0, 1fr); }
  .msg-list { max-height: 200px; }
}
@media (max-width: 860px) {
  .board { grid-template-columns: minmax(0, 1fr); padding-top: 10px; }
  .tabbar { display: block; position: sticky; top: 0; z-index: 10; padding: 10px clamp(14px, 2.4vw, 28px) 0; background: var(--canvas); }
  .tabbar .tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 3px; gap: 2px; background: #dfe4eb; border-radius: 10px; }
  .tabbar button { height: 40px; border: 0; background: none; border-radius: 8px; font-weight: 650; font-size: 14px; color: var(--ink-2); position: relative; }
  .tabbar button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(23, 32, 51, .12); }
  .tabbar .dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
  .tabbar .dot[hidden] { display: none; }
  .board.is-tabbed .pane:not(.is-active) { display: none; }
  .day-list { max-height: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .slot-row { grid-template-columns: 44px minmax(0, 1fr); }
  .slot-row .acts { grid-column: 2; justify-content: flex-start; max-width: none; }
  .act-note { width: auto; text-align: left; }
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slots button { height: 42px; }
  .resv-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .resv-fields .field:first-child { grid-column: 1 / -1; }
  .days { gap: 4px; }
  .app-head { gap: 10px; }
  .brand strong { font-size: 14px; }
  .tabbar button { font-size: 13px; }
  .panel-head .head-btn { margin-left: 0; width: 100%; height: 44px; margin-top: 6px; }
}
@media (max-width: 420px) { .app-head .close-day { margin-left: auto; } }
