:root {
  --ink: #1a1a1a;
  --ink-2: #5f5b56;
  --ink-3: #9a958f;
  --line: #e6e1da;
  --line-2: #d6d0c7;
  --bg: #f6f3ee;
  --card: #ffffff;
  --soft: #efeae3;
  --range: #3a3836;
  --ok: #2e7d4f;
  --booked: #a8462a;
  --booked-bg: #f7e6df;
  --err: #b3261e;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(26, 26, 26, .04), 0 8px 24px rgba(26, 26, 26, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 Montserrat, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1120px; margin: 0 auto; padding: 18px 20px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 40px; width: auto; display: block; }
.brand span {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); padding-left: 14px; border-left: 1px solid var(--line-2);
}
.top a.back { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.top a.back:hover { color: var(--ink); }

/* ---------- intro ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 140px; }
.intro { padding: 28px 0 32px; }
.intro h1 {
  font-size: clamp(32px, 5.2vw, 52px); line-height: 1.05; letter-spacing: -.025em;
  font-weight: 700; margin: 0 0 14px;
}
.intro p.lede { font-size: 18px; color: var(--ink-2); margin: 0 0 22px; max-width: 34em; }
.intro p.lede strong { color: var(--ink); font-weight: 600; }
.amenities { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.amenities li {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px 8px 11px; font-size: 14px; font-weight: 500;
}
.amenities svg { width: 18px; height: 18px; flex: none; }

/* ---------- layout ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; transition: opacity .25s ease;
}
.step.locked { opacity: .45; pointer-events: none; }
.step h2 {
  display: flex; align-items: center; gap: 12px;
  font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 18px;
}
.step h2 .n {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; flex: none;
  transition: background .2s;
}
.step.done h2 .n { background: var(--ok); }
.step h2 .hint { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.step h3 { font-size: 14px; font-weight: 600; margin: 24px 0 10px; color: var(--ink-2); }
.step.attention { animation: nudge .45s ease; border-color: var(--ink); }
@keyframes nudge { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- locations ---------- */
.locs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.loc {
  text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 16px 16px 15px; display: grid; gap: 3px; position: relative;
  transition: border-color .15s, background .15s, transform .1s;
}
.loc:hover { border-color: var(--line-2); }
.loc:active { transform: scale(.99); }
.loc strong { font-size: 17px; font-weight: 700; }
.loc small { font-size: 13px; color: var(--ink-2); line-height: 1.4; padding-right: 26px; }
.loc .tick {
  position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-2); display: grid; place-items: center;
}
.loc[aria-pressed="true"] { border-color: var(--ink); background: #fbfaf8; }
.loc[aria-pressed="true"] .tick { background: var(--ink); border-color: var(--ink); }
.loc[aria-pressed="true"] .tick::after {
  content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* ---------- dates ---------- */
.date-head { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; }
.date-head .month { font-weight: 600; font-size: 15px; margin-right: auto; }
.arrow {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); display: grid; place-items: center;
}
.arrow:disabled { opacity: .35; cursor: default; }
.arrow svg { width: 16px; height: 16px; }
.dates {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 8px) / 5);
  gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 2px; margin: -2px; scroll-behavior: smooth;
}
.dates::-webkit-scrollbar { display: none; }
.day {
  scroll-snap-align: start; border: 1.5px solid var(--line); background: var(--card);
  border-radius: 14px; padding: 10px 4px 9px; display: grid; justify-items: center; gap: 1px;
  transition: border-color .15s, background .15s;
}
.day:hover:not(:disabled) { border-color: var(--line-2); }
.day .dow { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.day .num { font-size: 22px; font-weight: 700; line-height: 1.25; }
.day .meta { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.day .meta.low { color: #a5621b; }
.day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.day[aria-pressed="true"] .dow, .day[aria-pressed="true"] .meta { color: rgba(255, 255, 255, .7); }
.day:disabled { cursor: default; background: var(--soft); border-color: transparent; }
.day:disabled .num { color: var(--ink-3); }
.day.week-start { margin-left: 0; }

/* ---------- times ---------- */
.times { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.time {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 12px;
  padding: 11px 0; font-size: 14px; font-weight: 600; position: relative;
  transition: border-color .15s, background .15s, color .15s;
}
.time:hover:not(:disabled) { border-color: var(--line-2); }
.time:disabled { background: var(--soft); border-color: transparent; color: var(--ink-3); cursor: default; text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.time.booked:disabled { background: var(--booked-bg); color: var(--booked); text-decoration: none; }
.time.in-range { background: var(--range); border-color: var(--range); color: #fff; }
.time[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .l-open { border: 1.5px solid var(--line-2); }
.legend .l-taken { background: var(--soft); }
.legend .l-booked { background: var(--booked); }
.legend .l-yours { background: var(--ink); }

.durations { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dur {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 12px 6px; display: grid; gap: 1px; justify-items: center;
  transition: border-color .15s, background .15s;
}
.dur strong { font-size: 16px; font-weight: 700; }
.dur span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.dur:hover:not(:disabled) { border-color: var(--line-2); }
.dur[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.dur[aria-pressed="true"] span { color: rgba(255, 255, 255, .7); }
.dur:disabled { background: var(--soft); border-color: transparent; color: var(--ink-3); cursor: default; }
.dur:disabled span { color: var(--ink-3); }

.empty {
  padding: 18px; border-radius: 12px; background: var(--soft); color: var(--ink-2);
  font-size: 14px; text-align: center;
}

/* ---------- booked times ---------- */
.booked-panel { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.booked-panel:empty { display: none; }
.booked-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.booked-head strong { font-size: 15px; font-weight: 700; }
.booked-head span { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tl { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.tl button {
  height: 40px; border: 0; padding: 0; border-radius: 6px; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .15s, background .15s;
}
.tl button:first-child { border-radius: 10px 6px 6px 10px; }
.tl button:last-child { border-radius: 6px 10px 10px 6px; }
.tl button:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.tl button.is-booked { background: var(--booked); box-shadow: none; cursor: default; }
.tl button.is-past { background: var(--soft); box-shadow: none; cursor: default; }
.tl button.is-yours { background: var(--ink); box-shadow: none; }
.tl-axis { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; margin-top: 6px; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.tl-axis span { white-space: nowrap; overflow: visible; }
.booked-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.booked-list li {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  background: var(--booked-bg); color: var(--booked); border-radius: 999px; padding: 6px 12px;
}
.booked-list li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--booked); }
.booked-list li.free { background: #e6f2ea; color: var(--ok); }
.booked-list li.free::before { background: var(--ok); }

/* ---------- details ---------- */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px;
  font-size: 16px; background: var(--card); transition: border-color .15s;
}
.field input:hover { border-color: var(--line-2); }
.field input:focus { outline: none; border-color: var(--ink); }
.field.invalid input { border-color: var(--err); }
.field .err { font-size: 12px; color: var(--err); display: none; }
.field.invalid .err { display: block; }

.rules {
  margin-top: 20px; border-radius: 14px; background: var(--soft); padding: 16px 18px;
}
.rules p { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.rules ul { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 6px; }
.rules li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); }
.rules li svg { width: 16px; height: 16px; flex: none; }
.agree { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; font-weight: 500; cursor: pointer; }
.agree input { position: absolute; opacity: 0; pointer-events: none; }
.agree .box {
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: var(--card);
  flex: none; display: grid; place-items: center; margin-top: 0; transition: background .15s, border-color .15s;
}
.agree input:checked + .box { background: var(--ink); border-color: var(--ink); }
.agree input:checked + .box::after {
  content: ""; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translate(1px, -1px);
}
.agree input:focus-visible + .box { outline: 2px solid var(--ink); outline-offset: 2px; }
.agree.invalid .box { border-color: var(--err); }

/* ---------- summary ---------- */
.summary { position: sticky; top: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}
.card h2 { font-size: 15px; font-weight: 700; margin: 0 0 16px; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-2); }
.srows { display: grid; gap: 14px; margin: 0; }
.srow { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.srow svg { width: 20px; height: 20px; margin-top: 1px; color: var(--ink-2); }
.srow dt { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.srow dd { margin: 0; font-weight: 600; font-size: 15px; }
.srow dd.placeholder { color: var(--ink-3); font-weight: 500; }
.total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px dashed var(--line-2); margin-top: 20px; padding-top: 18px;
}
.total span { font-size: 14px; color: var(--ink-2); }
.total strong { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.calc { font-size: 13px; color: var(--ink-3); text-align: right; margin-top: 2px; min-height: 20px; }

.pay {
  width: 100%; margin-top: 18px; border: 0; border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 16px; font-weight: 600; padding: 16px 20px; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .1s, background .15s, opacity .15s;
}
.pay:hover { background: #000; }
.pay:active { transform: scale(.985); }
.pay.busy { opacity: .7; pointer-events: none; }
.pay svg { width: 18px; height: 18px; }
.fine { font-size: 12px; color: var(--ink-3); text-align: center; margin: 12px 0 0; line-height: 1.5; }
.fine svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }

.demo-flag {
  font-size: 12px; font-weight: 600; background: #fff4d6; color: #7a5a00; border-radius: 10px;
  padding: 8px 12px; margin-bottom: 14px; display: none;
}
body.demo .demo-flag { display: block; }

/* ---------- mobile bar ---------- */
.mbar { display: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 14px; font-size: 14px; font-weight: 500;
  max-width: min(92vw, 440px); box-shadow: 0 10px 30px rgba(0,0,0,.2); transition: all .25s ease; z-index: 50;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--err); }

/* ---------- skeleton ---------- */
.skel { background: linear-gradient(90deg, var(--soft) 0%, #f7f4f0 50%, var(--soft) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 14px; height: 76px; }
@keyframes shimmer { to { background-position: -200% 0; } }

footer.foot { text-align: center; font-size: 13px; color: var(--ink-3); padding: 28px 20px 40px; }
footer.foot a { color: inherit; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .grid { grid-template-columns: 1fr; }
  .summary { display: none; }
  .wrap { padding-bottom: 120px; }
  .mbar {
    display: flex; align-items: center; gap: 14px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  .mbar .info { flex: 1; min-width: 0; }
  .mbar .info strong { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; }
  .mbar .info span { display: block; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mbar .pay { width: auto; margin: 0; padding: 14px 22px; flex: none; }
  .toast { bottom: 96px; }
}
@media (max-width: 640px) {
  .top { padding: 14px 16px; }
  .brand img { height: 32px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .intro { padding: 16px 0 24px; }
  .intro p.lede { font-size: 16px; }
  .amenities li { font-size: 13px; padding: 7px 12px 7px 10px; }
  .step { padding: 20px 16px; border-radius: 16px; }
  .locs { grid-template-columns: 1fr; }
  .times { grid-template-columns: repeat(4, 1fr); }
  .dates { grid-auto-columns: calc((100% - 3 * 8px) / 4.4); }
  .fields { grid-template-columns: 1fr; }
  .dur { padding: 11px 2px; }
  .tl { gap: 2px; }
  .tl button { height: 34px; }
  .tl-axis span:nth-child(even) { visibility: hidden; }
  .booked-head { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
