#booking-dialog {
  width: min(31.5rem,calc(100vw - 1.4rem)); max-width: none; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem);
  padding:0; margin:auto; overflow:hidden; border: 1px solid #d7d2d9; border-radius:.2rem;
  color:var(--ink); background:var(--paper); box-shadow:0 1.5rem 5rem #1c101e3d;
}
#booking-dialog::backdrop { background:#21171dcc; backdrop-filter:blur(4px); }
.booking-sheet { display:flex; flex-direction:column; max-height:inherit; }
.dialog-mast { display:flex; align-items:center; justify-content:space-between; margin:0 1.65rem; min-height:3.85rem; border-bottom:1px solid var(--rule); }
.dialog-mast .wordmark { font-size:2rem; }
.close-dialog { position:relative; width:2.75rem; height:2.75rem; border:0; padding:0; background:none; color:var(--ink); }
.close-dialog::before,.close-dialog::after { content:''; position:absolute; width:1.13rem; height:1px; top:50%; left:50%; background:currentColor; transform:translate(-50%,-50%) rotate(45deg); }
.close-dialog::after { transform:translate(-50%,-50%) rotate(-45deg); }
.close-dialog:hover { color:var(--wine); }
.dialog-body { padding:1.15rem 1.65rem 1.4rem; overflow-y:auto; overscroll-behavior:contain; min-height:0; }
.dialog-body h2 { margin:0 0 .8rem; font:500 clamp(2.1rem,4vw,3rem)/.97 var(--display); letter-spacing:-.043em; }
.dialog-body h2:focus { outline:none; }
.dialog-body p { margin:.6rem 0 .95rem; }
.dialog-body fieldset { min-width:0; margin:0; padding:0; border:0; }
.label,.dialog-body legend { display:block; padding:0; margin:0 0 .35rem; font-weight:600; }
.select { position:relative; }
.select::after { content:''; pointer-events:none; position:absolute; top:40%; right:1rem; width:.5rem; height:.5rem; border:solid var(--wine); border-width:0 1.5px 1.5px 0; transform:rotate(45deg); }
.select select,#code { display:block; width:100%; min-height:2.85rem; padding:.55rem .75rem; border:1px solid #aaa1ad; border-radius:.12rem; color:var(--ink); background:#fff; }
.select select { appearance:none; padding-right:2.1rem; }
.dialog-body .time-field { margin:1.05rem 0 1.1rem; }
.timezone { margin-left:.2rem; color:var(--muted); font-size:1rem; font-weight:normal; }
.times { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.37rem; }
.time { position:relative; display:block; cursor:pointer; }
.time input { position:absolute; width:1px; height:1px; margin:0; opacity:0; }
.time span { display:grid; place-items:center; min-height:2.75rem; border:1px solid #b2a7b3; border-radius:.12rem; color:var(--wine); font-variant-numeric:tabular-nums; transition:background .16s ease,color .16s ease; }
.time:hover span { background:#ece7ee; }
.time input:checked + span { background:var(--wine); border-color:var(--wine); color:white; }
.time input:focus-visible + span { outline:2px solid var(--wine); outline-offset:2px; }
.time-pager { display:flex; align-items:center; justify-content:space-between; gap:.3rem; margin:.1rem 0 -.3rem; color:var(--muted); font-size:1rem; }
.time-pager button, .text-button { display:inline-flex; align-items:center; min-height:2.75rem; background:transparent; color:var(--wine); border:0; padding:0; font-size:1rem; text-decoration:underline; text-underline-offset:.2em; }
.time-pager button { min-width:3rem; }
.dialog-body button:disabled,.time:has(input:disabled) { opacity:.48; cursor:default; }
.primary { width:100%; min-height:2.85rem; }
.outline { display:inline-flex; justify-content:center; align-items:center; min-height:2.8rem; font-weight:600; padding:.55rem .9rem; border:1px solid var(--wine); border-radius:.13rem; background:transparent; color:var(--wine); }
.outline:hover { background:#ede7ed; }
.dialog-body .date { margin:0 0 .65rem; padding:.62rem .8rem; border-left:2px solid var(--wine); background:#eee9f0; font:500 1.28rem/1.12 var(--display); }
.notice { color:var(--muted); }
.notice:empty { display:none; }
.notice.error { color:#8a253e; }
#code-form { margin-top:.85rem; }
.code-row { display:flex; align-items:center; gap:.45rem; }
.code-row input { flex:1 1 5.5rem; min-width:0; }
#code { letter-spacing:.18em; font-variant-numeric:tabular-nums; }
.dialog-body .hint { margin:.25rem 0 0; font-size:1rem; color:var(--muted); }
.links { display:flex; flex-wrap:wrap; gap:0 1rem; }
.contact-link { display:block; width:fit-content; margin:.7rem 0 0; padding:.35rem 0; font-size:1rem; color:var(--wine); }
@keyframes open-sheet { from { opacity:.1; transform:translateY(.65rem) scale(.99); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion:no-preference) { #booking-dialog[open] { animation:open-sheet .28s var(--ease); } }
@media (max-width:400px), (max-height:650px) {
  #booking-dialog { width:min(30rem,calc(100vw - 1rem)); max-height:calc(100dvh - 1rem); }
  .dialog-mast { min-height:2.95rem; margin:0 1rem; }
  .dialog-mast .wordmark { font-size:1.65rem; }
  .dialog-body { padding:.7rem 1rem .85rem; }
  .dialog-body h2 { font-size:2.2rem; margin-bottom:.55rem; }
  .dialog-body p { font-size:1rem; line-height:1.32; margin:.45rem 0 .65rem; }
  .dialog-body .time-field { margin:.65rem 0 .7rem; }
  .dialog-body .date { font-size:1.18rem; margin-bottom:.45rem; padding:.45rem .65rem; }
  #code-form { margin-top:.65rem; }
}
@media (min-width:530px) and (max-height:465px) {
  #booking-dialog { width:min(660px,calc(100vw - 16px)); }
  .dialog-mast { min-height:44px; margin-inline:16px; }
  .dialog-body { padding:6px 16px 9px; }
  .dialog-body h2 { font-size:28px; margin-bottom:5px; }
  #choices { display:grid; grid-template-columns:1fr 1.12fr; grid-template-rows:auto 1fr; column-gap:16px; }
  #choices > .label { grid-column:1; grid-row:1; }
  #choices > .select { grid-column:1; grid-row:2; align-self:start; }
  #choices .time-field { grid-column:2; grid-row:1 / span 2; margin:0; }
  .dialog-body .time-pager { margin:0; }
  #schedule > .primary { margin-top:5px; min-height:44px; }
  #verification { display:grid; grid-template-columns:1fr 1fr; column-gap:16px; align-items:start; }
  #verification > .date { grid-column:1; grid-row:1; }
  #verification > p:not(.date) { grid-column:1; grid-row:2; margin:2px 0 6px; }
  #telegram { grid-column:1; grid-row:3; min-height:44px; }
  #code-form { grid-column:2; grid-row:1 / span 2; margin:0; }
  #change { grid-column:2; grid-row:3; }
  #success { display:grid; grid-template-columns:1fr 1fr; column-gap:16px; align-items:start; }
  #success .date { grid-column:1; grid-row:1; }
  #success > p:not(.date) { grid-column:1; grid-row:2; }
  #calendar { grid-column:2; grid-row:1; }
  #success .links { grid-column:2; grid-row:2; }
}
