/* 나른 손님용 달력(/public) — 읽기 전용. 앱 설치·버튼 없이 달력만 보여 준다. */
:root {
  --brand: #33546B;
  --brand-soft: #E7EEF3;
  --accent: #8FB3A3;
  --bg: #ffffff;
  --line: #E3E9ED;
  --ink: #20262b;
  --muted: #7A8891;
  --sun: #C0392B;
  --sat: #2F6EA5;
  /* [오늘] 버튼 — [예약하기]와 같은 필 모양, 색은 연한 회색 (2026-11-28 이소영 님 지시) */
  --today-bg: #E5E7EB;
  --today-bg-active: #D6DAE0;
  --today-border: #D1D5DB;
  --today-ink: #4B5563;
  /* ---- 달력 높이 (2026-11-28 이소영 님 지시: 일정 위아래 폭을 확 줄인다) ----
     화면 높이를 억지로 채우지 않고 내용 높이에 딱 맞춘다. */
  /* 일정이 있는 칸: 마지막 일정 아래로 '글 한 줄' 들어갈 만큼만 비운다 */
  --cell-space-bottom: clamp(14px, 2.2vh, 22px);
  /* 예약 건과 다음 예약 사이 — 예약자별로 또렷하게 구분되게 약 6px */
  --chip-gap: 6px;
  /* 일정이 하나도 없는 주(줄): 날짜 숫자만 들어가는 높이 (PC 34px) */
  --week-empty-h: 34px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* 2026-11-28 이소영 님 지시 — 화면 높이(100dvh)를 채우지 않는다.
   채우면 일정 없는 빈 주까지 화면 높이만큼 늘어나 빈 줄이 줄지 않는다.
   높이는 오직 내용(날짜 + 일정 + 한 줄 여유)으로만 정해지고, 길면 그대로 세로 스크롤된다. */
html { height: auto; }

body {
  display: block;
  overscroll-behavior: none;
}

.pub {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 0;
}

/* 상단 룸 안내 4줄 — 2026-11-28 이소영 님 지시로 손님용 최상단에 넣는다.
   1행만 굵게(700), 2~4행은 기본 굵기(400). 가운데 정렬. */
.pub-legend {
  margin: 0 0 10px;
  text-align: center;
  color: #111;
  flex: 0 0 auto;
}

.pub-legend p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: #22262a;
}

.pub-legend .pub-legend-rooms {
  margin-bottom: 1px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111;
  word-spacing: 0.35em;
}

.pub-legend .pub-legend-rooms b {
  font-weight: 800;
  margin-right: 1px;
}

@media (max-width: 412px) {
  .pub-legend { margin-bottom: 8px; }
  .pub-legend p { font-size: 11px; line-height: 1.45; }
  .pub-legend .pub-legend-rooms { font-size: 12px; }
}

@media (max-width: 360px) {
  .pub-legend p { font-size: 10.5px; line-height: 1.42; }
  .pub-legend .pub-legend-rooms { font-size: 11.5px; }
}

/* 상단 */
.pub-head { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; flex: 0 0 auto; }
.pub-head[hidden] { display: none !important; }
.pub-head:empty { display: none; }

.pub-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand);
}

.pub-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.pub-notice {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 4px;
  background: #fff;
  border-radius: 10px;
}

.pub-notice a { color: var(--brand); text-decoration: none; }

/* 상단 버튼 두 개(예약하기·전화하기) */
.pub-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 2px 0 10px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.pub-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.pub-action:active { transform: translateY(1px); }
.pub-action-call { background: #fff; color: var(--brand); }

@media (max-width: 640px) {
  .pub-actions { gap: 7px; margin: 0 0 8px; }
  .pub-action { min-width: 78px; padding: 7px 12px; font-size: 12px; }
  /* 폰에서도 [예약하기]와 같은 모양, 글씨 폭에 맞춰 좁게 */
  .pub-nav .pub-today { padding: 6px 12px; font-size: 12px; }
}

/* 월 이동 줄 */
.pub-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
  flex: 0 0 auto;
  min-height: 0;
}

.pub-nav-pair { display: flex; gap: 8px; }

.pub-nav button {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.pub-nav button:active { background: var(--brand-soft); }

.pub-nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.pub-ym {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
  font-size: 22px;
  font-weight: 800;
  color: #111;
}

.pub-ym select {
  appearance: none;
  max-width: 96px;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0 2px;
  cursor: pointer;
}

/* [오늘] — 위 [예약하기] 버튼과 같은 둥근 필, 색은 연한 회색.
   폭은 '오늘' 글씨에 딱 맞게(min-width 없이), .pub-nav button(‹ ›)보다 세게 잡으려고 .pub-nav .pub-today. */
.pub-nav .pub-today {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 5px 12px;
  border: 1px solid var(--today-border);
  background: var(--today-bg);
  color: var(--today-ink);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: normal;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pub-nav .pub-today:active {
  background: var(--today-bg-active);
  border-color: var(--today-border);
  transform: translateY(1px);
}

.pub-nav .pub-today:focus-visible { outline: 2px solid var(--today-ink); outline-offset: 2px; }

/* 달력 — 남는 높이를 나눠 갖지 않고, 주(줄)마다 내용 높이에 딱 맞춘다 (2026-11-28 지시) */
.pub-cal {
  /* 좌우 스와이프는 우리가 받고, 세로 스크롤만 브라우저에 맡긴다. */
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.pub-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  flex: 0 0 auto;
  background: #FBFCFD;
  border-bottom: 1px solid var(--line);
}

.pub-week span {
  padding: 10px 0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.pub-week span:first-child { color: var(--sun); }
.pub-week span:last-child { color: var(--sat); }

.pub-grid {
  touch-action: pan-y;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  /* 줄 높이는 오직 그 주의 내용(날짜 + 일정)으로 정해진다 — 비율로 늘리지 않는다 */
  grid-auto-rows: auto;
  align-content: start;
  flex: 0 0 auto;
}

.pub-cell {
  min-height: 0;
  /* 아래 여백은 '글 한 줄' 들어갈 만큼만 — 일정이 1건이든 3건이든 같다 */
  padding: 7px 8px var(--cell-space-bottom);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.pub-cell:nth-child(7n) { border-right: 0; }

/* 일정이 한 건도 없는 주(줄)는 날짜 숫자만 들어가는 높이로 확 줄인다.
   2026-11-28 이소영 님 지시 — 지금보다 절반(PC 32~36px / 폰 24~28px). */
.pub-cell.week-empty {
  min-height: var(--week-empty-h);
  padding-top: 6px;
  padding-bottom: 6px;
}
.pub-cell.week-empty .pub-dnum { margin-bottom: 0; }

.pub-cell.out { background: #FCFDFE; }
.pub-cell.out .pub-dnum { color: #C4CDD3; }

.pub-dnum {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 3px;
}

.pub-cell.sun .pub-dnum { color: var(--sun); }
.pub-cell.sat .pub-dnum { color: var(--sat); }

.pub-cell.today { background: #F2F7FA; }
.pub-cell.today .pub-dnum {
  display: inline-block;
  align-self: flex-start;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  text-align: center;
  line-height: 22px;
  font-size: 12.5px;
}

.pub-chip {
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

/* 예약 건과 다음 예약 사이 간격 — 예약자별로 또렷하게 구분한다 (약 6px, 2026-11-28 지시).
   한 예약 안의 '시간-이름' 줄 사이는 좁게(1px) 그대로 둔다. */
.pub-chip + .pub-chip { margin-top: var(--chip-gap); }

.pub-chip-time { display: inline; }
.pub-chip-name { display: inline; margin-left: 3px; }

/* 룸 코드 알파벳(H·W·S·※)은 시간과 같이 굵게 — 2026-11-28 이소영 님 지시
   (같은 날 "900두께만 해" 지시로 800 → 900, 크기는 그대로) */
.pub-chip b,
.pub-chip-cat { font-weight: 900; color: var(--ink); margin-right: 3px; }
/* 손님용은 일정 글씨색을 검정 한 가지로 통일한다(색 구분은 관리자 앱에만). */

.pub-more { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.pub-empty { padding: 40px 0; text-align: center; color: var(--muted); font-size: 13.5px; }

.pub-foot {
  margin: 14px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: #A9B4BB;
}

@media (max-width: 900px) {
  /* 태블릿 — 빈 주는 그 사이 높이 */
  :root { --week-empty-h: 30px; }
}

@media (max-width: 760px) {
  .pub { padding: 12px 10px 0; }
  .pub-title { font-size: 18px; }
  .pub-ym { font-size: 17px; gap: 2px; min-width: 0; white-space: nowrap; }
  .pub-ym select { max-width: 62px; }
  .pub-nav button { width: 36px; height: 36px; font-size: 16px; }
  .pub-cell { padding: 5px 4px var(--cell-space-bottom); }
  .pub-cell.week-empty { padding-top: 5px; padding-bottom: 5px; }
  .pub-dnum { font-size: 12px; }
  .pub-chip { font-size: 10.5px; }
  .pub-week span { padding: 7px 0; font-size: 11.5px; }
}

/* --------------------- 모바일에서 달을 넘길 때 부드러운 좌우 슬라이드
   public.js 가 .pub-cal 에 방향 클래스를 붙인다(폰 폭 900px 이하에서만).
   slide-out-* : 지금 달력이 넘기는 쪽으로 짧게(0.14s) 밀려 나간다.
   slide-in-*  : 새 달을 다 그린 뒤 반대쪽에서 제자리로 들어온다(0.20s).
   dragging    : 손가락으로 미는 동안 손가락을 따라 살짝 따라온다(전환은 끈다). */
@media (max-width: 900px) {
  .pub { overflow-x: hidden; overflow-x: clip; }
  .pub-cal.dragging { transition: none; will-change: transform; }
  .pub-cal.slide-out-next {
    transform: translate3d(-26%, 0, 0) scale(.99);
    opacity: .4;
    transition: transform .14s ease-in, opacity .14s ease-in;
    will-change: transform;
  }
  .pub-cal.slide-out-prev {
    transform: translate3d(26%, 0, 0) scale(.99);
    opacity: .4;
    transition: transform .14s ease-in, opacity .14s ease-in;
    will-change: transform;
  }
  .pub-cal.month-wait { opacity: .55; transition: opacity .12s ease-out; }
  .pub-cal.slide-in-next { animation: pubSlideInNext .2s ease-out both; will-change: transform; }
  .pub-cal.slide-in-prev { animation: pubSlideInPrev .2s ease-out both; will-change: transform; }
}

@keyframes pubSlideInNext {
  from { transform: translate3d(26%, 0, 0); opacity: .4; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}
@keyframes pubSlideInPrev {
  from { transform: translate3d(-26%, 0, 0); opacity: .4; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}

/* ---------- 모바일(≤640px): 일정을 시간 위·이름 아래 두 줄로, 글씨는 조금 크게 ---------- */
@media (max-width: 640px) {
  .pub-grid, .pub-cell, .pub-chip, .pub-chip-cat, .pub-chip-time, .pub-chip-name {
    min-width: 0; max-width: 100%; box-sizing: border-box;
  }
  .pub-cell { padding: 5px 1px var(--cell-space-bottom); overflow: hidden; }
  /* 폰 — 빈 주는 절반(24~28px)까지 */
  :root { --week-empty-h: 26px; }
  .pub-cell.week-empty { padding-top: 5px; padding-bottom: 5px; }
  /* 2026-11-28 이소영 님 지시 "시간은 키우고 날짜숫자들은 다시 원래대로해" —
     폰 달력 날짜 숫자(1·2·3…)는 원래 크기(13px)로 되돌리고, 키운 만큼은 예약 시간 쪽에 준다
     (아래 --pub-time-fs). 오늘 날짜도 원래 13.5px·원 22px 로 복구.
     PC·태블릿(641px~) 숫자 크기는 그대로 둔다. */
  .pub-dnum { font-size: 13px; }
  /* 오늘 날짜는 브랜드색 원 안 숫자 — 원(22px)은 원래 크기 그대로.
     "28" 두 자리도 min-width 가 아니라 내용 폭만큼 늘어나 원 밖으로 넘치지 않는다. */
  .pub-cell.today .pub-dnum {
    font-size: 13.5px;
    min-width: 22px;
    height: 22px;
    line-height: 22px;
  }
  .pub-chip {
    /* 두 줄(시간 위·이름 아래)을 2열 격자로 — 아랫줄 이름이 룸 코드 뒤 시간과 같은 x 에서 시작한다.
       2026-11-28 이소영 님 지시. */
    /* 2026-11-28 이소영 님 지시 "시간은 키우고" — 폰 예약 시간을 키운다.
       기존 clamp(8.8px, 2.4vw, 11.2px)(390px 폭 9.36px) → clamp(10px, 2.85vw, 12.2px)(390px 폭 11.1px).
       이름(10.14px)보다 또렷하게 크고, '14:30~17:30' 같은 긴 시간은 public.js fitChipTimes() 가
       칸 폭에 맞춰 자동 축소하므로 넘침·잘림은 생기지 않는다. */
    --pub-time-fs: clamp(10px, 2.85vw, 12.2px);
    --pub-name-fs: clamp(9px, 2.6vw, 12px);
    display: grid;
    grid-template-columns: calc(var(--pub-time-fs) * 0.98) minmax(0, 1fr);
    column-gap: calc(var(--pub-time-fs) * 0.12);
    /* 2026-11-28 이소영 님 지시 — 시간 줄과 이름 줄 사이 간격을 폰에서만 약 10% 좁힌다.
       (row-gap 1px → 0, 줄 높이 1.3 → 1.26 — 줄 피치 13.2px → 11.8px, 약 10%.
        예약과 다음 예약 사이 6px(--chip-gap)는 그대로 둔다.) */
    row-gap: 0;
    align-items: start;
    white-space: normal;
    font-size: 12.5px;
    line-height: 1.26;
  }
  .pub-chip-cat {
    grid-column: 1;
    grid-row: 1;
    margin-right: 0;
    font-size: var(--pub-time-fs);
    font-weight: 900;
    /* 2026-11-28 이소영 님 지시 "알파벳은 조금 더 굵게" — 시스템 폰트에 900 웨이트가 없어
       700과 차이가 잘 안 보이므로 획을 같은 색으로 살짝 덧그려(H·W·S) 실제 화면에서 더 두껍게 보이게 한다.
       글씨 크기는 그대로. */
    -webkit-text-stroke: 0.45px currentColor;
    line-height: 1.26;
    color: #111;
    white-space: nowrap;
  }
  .pub-chip-time {
    grid-column: 2;
    grid-row: 1;
    /* 실제 폭이 넘치면 public.js fitChipTimes() 가 이 font-size 를 칸에 맞게 줄인다. */
    font-size: var(--pub-time-fs);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    line-height: 1.26;
  }
  .pub-chip-name {
    grid-column: 2;
    grid-row: 2;
    margin-left: 0;
    font-size: var(--pub-name-fs);
    letter-spacing: -0.02em;
    font-weight: 400;
    /* 2026-11-28 이소영 님 지시 "이름은 진한 회색으로" — 폰에서만 이름만 진한 회색,
       룸 코드·시간은 검정(#111) 그대로, PC 색은 건드리지 않는다. */
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.26;
  }
  /* 룸 코드가 없는 일정은 들여쓰기 없이 두 줄 모두 왼쪽부터 */
  .pub-chip.pub-chip-nocat .pub-chip-time,
  .pub-chip.pub-chip-nocat .pub-chip-name {
    grid-column: 1 / -1;
  }
}

/* 일반 모니터(1024px~): 손님용 일정 글씨를 16px 로 (768~1023px 은 12px 그대로) */
@media (min-width: 1024px) {
  .pub-chip { font-size: 16px; }
  .pub-chip b { font-size: 16px; }
}

/* ---- iframe(홈페이지) 안에서만: iframe 높이를 꽉 채운다 ------------------------------
   2026-11-28 이소영 님 지시 — narnnstudio.kr 스케쥴 페이지에서 달력 아래 흰 빈 여백이
   남지 않도록, 홈페이지 iframe 안에서는 달력 줄(주)들이 iframe 높이를 나눠 채운다.
   · 일정이 적은 달: 남는 높이를 주(行)들이 똑같이 나눠 가져 아래 빈 공간이 없다.
   · 일정이 많은 달: 줄이 내용만큼 커지고, 넘치면 페이지가 세로로 스크롤된다(잘리지 않음).
   · /public 을 직접 열었을 때(iframe 아님)는 이 규칙이 적용되지 않는다. */
html.pub-fill body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
html.pub-fill .pub {
  flex: 1 1 auto;
  min-height: 100vh;
  min-height: 100dvh;
}
html.pub-fill .pub-cal {
  flex: 1 1 auto;
}
html.pub-fill .pub-grid {
  flex: 1 1 auto;
  align-content: stretch;
}
