/* 3분할 달력형 — 흑백 위주의 차분한 예약 카드. 서체 IBM Plex Sans KR */
:root {
  --bg: #F2F2EF;
  --card: #FFFFFF;
  --ink: #161616;
  --ink-2: #4A4A47;
  --muted: #8A8A85;
  --line: #E3E3DE;
  --soft: #ECECE7;
  --hatch: #F6F6F3;
  --ok: #1E6B4E;
  --warn-bg: #FFF2C6;
  --warn: #6B5208;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 'IBM Plex Sans KR', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2 { margin: 0; letter-spacing: -0.3px; }
[hidden] { display: none !important; }

.page { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

.mast { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 18px; }
.mast__brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; text-decoration: none; }
.mast__brand svg { width: 26px; height: 26px; }
.mast__owner { font-size: 13.5px; font-weight: 600; text-decoration: none; padding: 7px 12px; border: 1px solid var(--ink); border-radius: 6px; white-space: nowrap; }
.mast__owner:hover { background: var(--ink); color: #fff; }

/* 카드 3칸 */
.card {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 520px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px -18px rgba(0, 0, 0, .25);
  overflow: hidden;
}
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 240px; min-width: 0; }
.card--form .stage, .card--done .stage { grid-template-columns: minmax(0, 1fr); }
.card--done { grid-template-columns: minmax(0, 1fr); }
.card--done .info { display: none; }

.info { padding: 26px 24px; border-right: 1px solid var(--line); }
.info__who { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.info__title { font-size: 22px; font-weight: 700; line-height: 1.3; margin-bottom: 16px; }
.info__meta { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 9px; color: var(--ink-2); font-size: 14px; }
.info__meta li { display: flex; gap: 9px; align-items: flex-start; }
.info__meta svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--muted); }
.types { margin: 0; padding: 0; border: 0; min-width: 0; }
.types legend { padding: 0; margin-bottom: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .3px; }
.type { position: relative; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 11px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 14px; }
.type input { position: absolute; opacity: 0; pointer-events: none; }
.type:hover { border-color: var(--ink-2); }
.type.is-on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.type__name { font-weight: 600; }
.type__price { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.type:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.info__note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

.pane { padding: 26px 24px; min-width: 0; }
.pane h2 { font-size: 16px; font-weight: 600; }

/* 달력 */
.cal__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.cal__nav { display: flex; align-items: center; gap: 6px; }
.cal__nav b { font-weight: 600; font-size: 15px; min-width: 92px; text-align: center; }
.cal__nav button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; }
.cal__nav button:hover:not(:disabled) { background: var(--soft); }
.cal__nav button:disabled { color: #CFCFCA; cursor: default; }
.cal__dow, .cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__dow span { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); padding-bottom: 4px; }
.cal__dow span:first-child { color: #B0473A; }
.cal__day {
  position: relative; aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 8px;
  background: transparent; font-size: 15px; color: #B9B9B4; cursor: default;
}
.cal__day.is-closed { text-decoration: line-through; text-decoration-color: #D0D0CB; }
.cal__day.is-full { color: var(--muted); background: repeating-linear-gradient(135deg, transparent 0 4px, #EFEFEA 4px 6px); }
.cal__day.is-avail { background: var(--soft); color: var(--ink); font-weight: 700; cursor: pointer; }
.cal__day.is-avail:hover { background: #DCDCD6; }
.cal__day.is-on { background: var(--ink); color: #fff; }
.cal__day.is-today::after { content: ''; position: absolute; left: 50%; bottom: 6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.cal__key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 18px 0 0; font-size: 12.5px; color: var(--muted); }
.k { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: -6px; vertical-align: -1px; }
.k--avail { background: var(--soft); border: 1px solid #CFCFC8; }
.k--full { background: repeating-linear-gradient(135deg, #fff 0 2px, #DADAD4 2px 3px); border: 1px solid var(--line); }
.k--closed { border: 1px solid var(--line); }

/* 시간 목록 */
.times { border-left: 1px solid var(--line); }
.times__head { margin-bottom: 14px; }
.times__head h2 { margin-bottom: 10px; }
.toggle { display: inline-flex; padding: 2px; border-radius: 7px; background: var(--soft); }
.toggle button { border: 0; background: transparent; padding: 4px 9px; border-radius: 5px; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.toggle button.is-on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.times__empty { color: var(--muted); font-size: 14px; margin: 0; }
.times__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.slot {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14.5px;
}
.slot b { font-weight: 600; }
.slot em { font-style: normal; font-size: 12px; color: var(--muted); }
.slot--open { cursor: pointer; border-color: #C9C9C3; }
.slot--open:hover { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.slot--taken { background: var(--hatch); color: #ABABA5; }
.slot--taken b { text-decoration: line-through; }
.slot--blocked { border-style: dashed; color: #9A9A94; }
.slot--past { border-color: transparent; color: #C2C2BC; background: transparent; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.slot--picked { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.next { border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; min-height: 44px; }
.next:hover { background: #000; }

/* 입력 폼 */
.form-pane { max-width: 520px; }
.back { border: 0; background: none; padding: 0; margin-bottom: 18px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.back:hover { color: var(--ink); text-decoration: underline; }
.form-pane h2 { font-size: 20px; margin-bottom: 12px; }
.picked { display: flex; flex-direction: column; margin: 0 0 22px; padding: 12px 14px; border-left: 3px solid var(--ink); background: var(--hatch); }
.picked span { font-size: 13.5px; color: var(--ink-2); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 5px; font-size: 13.5px; font-weight: 600; }
.field i { font-style: normal; font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #CFCFC9; border-radius: 8px; background: #fff;
  font: inherit; font-size: 16px; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field textarea { resize: vertical; }
.error { margin: 0 0 12px; color: #B0372A; font-size: 13.5px; font-weight: 600; }
.error:empty { display: none; }
.submit {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px;
  border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
}
.submit:hover { background: #000; }
.fine { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* 완료 — 카드 전체가 요약 카드로 바뀐다 */
.done { max-width: 520px; margin: 0 auto; padding: 48px 24px 52px; text-align: center; }
.done > svg { width: 52px; height: 52px; color: var(--ok); }
.done h2 { font-size: 22px; margin: 14px 0 8px; }
.badge { display: inline-block; margin: 0 0 22px; padding: 3px 10px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); font-size: 12.5px; font-weight: 700; }
.done dl { display: grid; grid-template-columns: 76px 1fr; gap: 8px 12px; margin: 0 0 20px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.done dt { color: var(--muted); font-size: 13.5px; }
.done dd { margin: 0; font-weight: 500; }
.done__msg { color: var(--ink-2); font-size: 14px; margin: 0 0 22px; }
.done__act { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ghost { min-height: 46px; padding: 0 18px; border: 1px solid #C9C9C3; border-radius: 8px; background: #fff; cursor: pointer; font-weight: 500; }
.ghost:hover { border-color: var(--ink); }

.maker { margin: 22px 0 0; }
.maker p { margin: 0; font-size: 13px; color: var(--ink-2); max-width: 760px; }
.maker b { color: var(--ink); margin-right: 3px; }
.maker a { font-weight: 600; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 24px 0 40px; margin-top: 24px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }

@media (max-width: 900px) {
  .card { grid-template-columns: 1fr; }
  .info { border-right: 0; border-bottom: 1px solid var(--line); }
  .types > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .type { flex-direction: column; gap: 0; margin: 0; }
}
@media (max-width: 640px) {
  .page { padding: 0 12px; }
  .mast { padding: 16px 4px 14px; }
  .info, .pane { padding: 20px 16px; }
  .info__title { font-size: 20px; }
  .types > div { grid-template-columns: 1fr; }
  .type { flex-direction: row; }
  .stage { grid-template-columns: 1fr; }
  .times { border-left: 0; border-top: 1px solid var(--line); }
  .times__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
  .times__head h2 { margin: 0; }
  .times__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pair { grid-column: 1 / -1; }
  .cal__dow, .cal__grid { gap: 3px; }
  .cal__day { min-height: 0; font-size: 14px; }
  .done { padding: 36px 8px 40px; }
  .done__act > * { width: 100%; }
  .maker { padding: 0 4px; }
  .foot { padding: 20px 4px 32px; flex-direction: column; }
}
@media (max-width: 640px) {
  .info__note { display: none; }
  .info__meta { margin-bottom: 16px; gap: 6px; font-size: 13.5px; }
  .type { padding: 9px 12px; }
}
