:root {
  --bg: #F4F1EA;
  --ink: #111418;
  --sub: #5E636B;
  --line: #E2DDD2;
  --card: #FFFFFF;
  --accent: #FF5A36;
  --accent-ink: #D9431F;
  --accent-soft: #FFEDE7;
  --ok: #1F7A4D;
  --mono: "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.mark { font-family: var(--mono); font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.mark b { color: var(--accent); }
.muted { color: var(--sub); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.err { color: var(--accent-ink); font-size: 14px; min-height: 20px; }

/* ---------- 버튼·입력 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #2A2E34; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.btn.danger { background: transparent; color: var(--accent-ink); border-color: transparent; }
.btn.danger:hover { border-color: var(--accent-ink); }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=number], input[type=time], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }

/* ---------- 공통 틀 ---------- */
.top { display: flex; align-items: center; justify-content: space-between; max-width: 1040px; margin: 0 auto; padding: 22px 20px; }
.top .mark { font-size: 20px; }
.top .who { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px 80px; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.foot { text-align: center; padding: 24px 0 40px; font-size: 13px; }
.foot a { text-decoration: none; }

/* ---------- 로그인 ---------- */
.login { width: 100%; max-width: 380px; padding: 40px 32px; text-align: center; }
.login .mark { font-size: 34px; display: block; margin-bottom: 6px; }
.login p { margin: 0 0 28px; }
.login .btn { width: 100%; }

/* ---------- 대시보드 ---------- */
h2 { font-size: 15px; margin: 36px 0 12px; display: flex; align-items: center; justify-content: space-between; }
.notice { padding: 16px 18px; border-radius: 10px; background: var(--accent-soft); display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.me { padding: 20px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.me .link { font-family: var(--mono); font-size: 15px; word-break: break-all; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.type { padding: 18px 18px 14px; border-top: 4px solid var(--accent); display: flex; flex-direction: column; gap: 6px; }
.type.off { border-top-color: var(--line); }
.type.off .t { color: var(--sub); }
.type .t { font-weight: 700; font-size: 16px; }
.type .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bookings { overflow: hidden; }
.bk { display: grid; grid-template-columns: 170px 1fr auto; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: center; }
.bk:first-child { border-top: 0; }
.bk.canceled { opacity: .5; }
.bk .when { font-weight: 600; }
.empty { padding: 28px 18px; text-align: center; }

/* ---------- 편집 창 ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(17,20,24,.25); }
dialog::backdrop { background: rgba(17,20,24,.4); }
dialog form { padding: 24px; }
dialog h3 { margin: 0 0 18px; font-size: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.week { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; }
.wd { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); min-height: 52px; }
.wd:first-child { border-top: 0; }
.wd label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.wd .times { display: flex; align-items: center; gap: 8px; }
.wd .times input { height: 36px; width: 140px; }
.dlg-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.prefix span { padding: 0 0 0 12px; color: var(--sub); font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.prefix input { border: 0; padding-left: 2px; font-family: var(--mono); font-size: 13px; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- 움직임 ---------- */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes from-right { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes from-left { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: .9; } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ring { from { box-shadow: 0 0 0 0 rgba(255, 90, 54, .45); } to { box-shadow: 0 0 0 18px rgba(255, 90, 54, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.enter { animation: rise .45s var(--ease) both; }
.btn { transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease), opacity .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
::view-transition-old(root) { animation: fade .18s reverse both; }
::view-transition-new(root) { animation: rise .32s var(--ease) both; }

/* ---------- 예약 페이지 ---------- */
.book { width: 100%; max-width: 1060px; display: grid; grid-template-columns: 320px 1fr; height: 700px; max-height: calc(100vh - 40px); min-height: 600px; overflow: hidden; }
.book .info, .book .right { overflow-y: auto; }
.struck { text-decoration: line-through; color: var(--sub); }
.book .info { padding: 32px 28px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.book .info .owner { color: var(--sub); font-weight: 600; }
.book .info h1 { font-size: 26px; line-height: 1.3; margin: 4px 0 22px; }
.meta { display: flex; gap: 10px; align-items: flex-start; color: var(--sub); font-weight: 600; margin-bottom: 12px; }
.meta svg { flex: none; margin-top: 2px; }
.meta.accent { color: var(--ink); }
.meta.accent svg { color: var(--accent); }
.picked { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .35s var(--ease), opacity .3s; }
.picked > div { overflow: hidden; }
.picked.on { grid-template-rows: 1fr; opacity: 1; }
.picked.on > div { padding-top: 12px; margin-top: 2px; border-top: 1px solid var(--line); }
.desc { white-space: pre-wrap; margin-top: 12px; color: var(--ink); }
.info .brand { margin-top: auto; padding-top: 28px; font-size: 13px; }
.right { min-width: 0; }
.pick { padding: 32px 28px; display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 32px; }
.pick h2 { margin: 0 0 22px; font-size: 20px; }
.month { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 16px; font-weight: 600; }
.month .label { min-width: 110px; text-align: center; }
.month button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; font-size: 20px; color: var(--accent-ink); transition: background .15s, transform .12s; }
.month button:not(:disabled):hover { background: var(--accent-soft); }
.month button:not(:disabled):active { transform: scale(.9); }
.month button:disabled { color: var(--line); cursor: default; }
.cal-wrap { overflow: hidden; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; }
.cal.slide-next { animation: from-right .3s var(--ease); }
.cal.slide-prev { animation: from-left .3s var(--ease); }
.cal .pad { aspect-ratio: 1; }
.cal .dow { font-size: 12px; font-weight: 600; color: var(--sub); padding-bottom: 6px; }
.cal button { aspect-ratio: 1; max-width: 52px; width: 100%; margin: 0 auto; border-radius: 50%; border: 0; background: transparent; color: var(--sub); font-size: 15px; position: relative; transition: background .18s, color .18s, transform .18s var(--spring), box-shadow .18s; }
.cal button.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; cursor: pointer; }
.cal button.on:hover { background: #FFD9CC; transform: scale(1.08); }
.cal button.on:active { transform: scale(.94); }
.cal button.sel, .cal button.sel:hover { background: var(--accent); color: #fff; transform: scale(1.04); box-shadow: 0 6px 16px rgba(255, 90, 54, .35); }
.cal button.today::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.cal.loading button:not(:disabled), .cal.loading button { background: #EEEAE2; color: transparent; animation: pulse 1.2s ease-in-out infinite; }
.cal.loading button:nth-child(3n) { animation-delay: .15s; }
.cal.loading button:nth-child(3n+1) { animation-delay: .3s; }
.cal-note { height: 32px; text-align: center; }
.cal-note p { margin: 10px 0 0; animation: fade .3s both; }
.tz { display: block; margin-top: 18px; }
.tz span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.tz select { max-width: 320px; }
.times-col { padding-top: 50px; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.pick { height: 100%; }
.cal-col { min-height: 0; }
.times-col .day { font-weight: 600; margin: 0 0 14px; animation: fade .3s both; }
.times-empty { height: 100%; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 14px; border: 1px dashed var(--line); border-radius: 12px; animation: fade .3s both; }
.times-empty svg { color: var(--line); }
.times-list { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; overflow-y: auto; padding: 2px 4px 24px 2px; mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); }
.slot { display: grid; grid-template-columns: 1fr 0fr; gap: 0; transition: grid-template-columns .28s var(--ease), gap .28s var(--ease); animation: rise .32s var(--ease) both; animation-delay: calc(var(--i, 0) * 28ms); }
.slot.sel { grid-template-columns: 1fr 1fr; gap: 8px; }
.slot button { height: 48px; border-radius: 8px; font-weight: 700; cursor: pointer; min-width: 0; overflow: hidden; white-space: nowrap; }
.slot .time { border: 1px solid var(--accent); background: #fff; color: var(--accent-ink); transition: background .18s, color .18s, border-color .18s, box-shadow .18s; }
.slot .time:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.slot.sel .time { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
.slot .go { border: 0; padding: 0; background: var(--accent); color: #fff; opacity: 0; transition: opacity .2s .05s, background .15s; }
.slot.sel .go { opacity: 1; }
.slot .go:hover { background: var(--accent-ink); }
.skel-line { height: 18px; width: 60%; border-radius: 6px; background: #EEEAE2; animation: pulse 1.2s ease-in-out infinite; margin-bottom: 14px; }
.skel-slot { height: 48px; border-radius: 8px; background: #EEEAE2; animation: pulse 1.2s ease-in-out infinite; }
.skel-slot:nth-child(odd) { animation-delay: .2s; }
.form { padding: 32px 28px; max-width: 520px; }
.form h2 { margin: 0 0 20px; font-size: 20px; }
.form .msg { color: var(--accent-ink); font-size: 13px; min-height: 0; margin-top: 6px; }
.form .msg:empty { display: none; }
input.bad { border-color: var(--accent); animation: shake .35s ease; }
.back { border: 0; background: transparent; padding: 0; margin-bottom: 18px; cursor: pointer; color: var(--sub); font-weight: 600; transition: color .15s, transform .15s var(--ease); }
.back:hover { color: var(--ink); transform: translateX(-3px); }
.submit { position: relative; min-width: 128px; }
.submit .spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; }
.submit.busy .spin { display: block; }
.submit.busy .txt::after { content: " 중…"; }
.submit.busy { opacity: 1 !important; }
.done { text-align: center; padding: 48px 28px; max-width: 440px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.done .done-actions, .done .confirm { align-self: center; }
.check { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin: 0 auto 18px; }
.check.off { background: var(--sub); }
.check.pop { animation: pop .5s var(--spring) both, ring .9s .35s ease-out; }
.check .tick { stroke-dasharray: 24; stroke-dashoffset: 0; }
.check.pop .tick { stroke-dashoffset: 24; animation: draw .35s .3s var(--ease) forwards; }
.done h2 { justify-content: center; margin: 0 0 8px; font-size: 22px; }
.done .summary { animation: rise .45s .2s var(--ease) both; }
.summary { text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin: 22px 0; }
.summary .meta { margin-bottom: 8px; }
.summary .meta:last-child { margin-bottom: 0; }
.done-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.confirm { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 10px; background: var(--accent-soft); width: 100%; }
.confirm .row { display: flex; gap: 8px; }
.loading { color: var(--sub); padding: 40px 0; text-align: center; }
.list { width: 100%; max-width: 560px; padding: 32px 28px; }
.list h1 { margin: 0 0 20px; font-size: 24px; }
.list a.item { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; text-decoration: none; border-left: 4px solid var(--accent); transition: border-color .15s, transform .2s var(--ease), box-shadow .2s; animation: rise .4s var(--ease) both; animation-delay: calc(.1s + var(--i, 0) * 60ms); }
.list a.item:hover { border-color: var(--ink); border-left-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(17, 20, 24, .08); }
.list a.item .arrow { color: var(--sub); transition: transform .2s var(--ease), color .2s; }
.list a.item:hover .arrow { transform: translateX(4px); color: var(--accent); }

@media (max-width: 1060px) and (min-width: 861px) {
  .book { grid-template-columns: 250px 1fr; }
  .pick { grid-template-columns: minmax(0, 1fr) 170px; gap: 24px; padding: 28px 22px; }
}
@media (max-width: 860px) {
  .center { place-items: start center; padding: 12px; }
  .book { grid-template-columns: 1fr; height: auto; max-height: none; min-height: 0; }
  .book .info, .book .right { overflow: visible; }
  .pick { height: auto; }
  .done { min-height: 0; }
  .book .info { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px; }
  .book .info h1 { font-size: 22px; margin-bottom: 14px; }
  .book .info .meta { margin-bottom: 6px; }
  .book .info .brand { display: none; }
  .pick { grid-template-columns: 1fr; gap: 0; padding: 20px 14px 24px; }
  .pick h2 { font-size: 18px; margin-bottom: 14px; }
  .times-col { padding-top: 0; scroll-margin-top: 12px; }
  .times-col:not(:empty) { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
  .times-list { max-height: none; overflow: visible; padding-bottom: 2px; mask-image: none; }
  .form { padding: 24px 20px; }
  .done { padding: 36px 20px; }
  .bk { grid-template-columns: 1fr; gap: 4px; }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .wd { grid-template-columns: 1fr; }
  .wd .times input { width: 100%; }
  .top { padding: 16px; }
  .wrap { padding: 0 16px 60px; }
  .cal { gap: 4px; }
  .cal button { font-size: 14px; }
}
.mbar { display: none; }
@media (max-width: 860px) {
  .times-list { display: grid; grid-template-columns: 1fr 1fr; }
  .slot, .slot.sel { grid-template-columns: 1fr; gap: 0; }
  .slot .go { display: none; }
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(17, 20, 24, .08); transform: translateY(110%); transition: transform .32s var(--ease); }
  .mbar.on { transform: none; }
  .mbar-text { display: flex; flex-direction: column; line-height: 1.35; font-size: 14px; }
  .mbar-text b { font-size: 16px; }
  .mbar .btn { min-width: 110px; }
  .form .submit { width: 100%; height: 48px; }
  .right:has(.slot.sel) { padding-bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
