.booking-stage {
  --rail-handle: clamp(49px, 4.5vw, 76px);
  --rail-safe: env(safe-area-inset-right, 0px);
  --rail-reserve: calc(2 * var(--rail-handle) + var(--rail-safe));
  position: relative;
  isolation: isolate;
}
.booking-stage > .shell.hero {
  --side: max(var(--margin), calc((100% - 1344px) / 2));
  width: auto;
  min-height: 548px;
  margin: 0 calc(var(--rail-reserve) + clamp(14px, 2vw, 34px)) 0 var(--side);
}
.hero.booking-stage .hero-copy { max-width: calc(100% - var(--rail-reserve)); }
.booking-rail {
  --panel-width: min(clamp(292px, 24vw, 363px), calc(100vw - var(--rail-reserve)));
  --gold: #ead7aa;
  --pale: #fff9e9;
  --divider: rgb(247 234 197 / 27%);
  position: absolute;
  z-index: 4;
  inset: 0 0 0 auto;
  display: flex;
  align-items: stretch;
  padding-right: var(--rail-safe);
  color: var(--pale);
  background: #263d31;
  box-shadow: -1px 0 0 #f4e4be75;
  font: 400 14px/1.4 var(--sans, system-ui, sans-serif);
}
.booking-rail *, .booking-rail { box-sizing: border-box; }
.booking-rail button, .booking-rail select { font: inherit; color: inherit; }
.booking-rail button, .booking-rail select, .rail-handle { touch-action: manipulation; }
.booking-rail button, .booking-rail select { cursor: pointer; }
.booking-rail button:disabled { cursor: default; }
.booking-rail :is(a,button,select):focus-visible { outline: 2px solid #ffe7a8; outline-offset: -3px; }
.booking-rail .rail-handle {
  position: relative;
  display: flex;
  flex: 0 0 var(--rail-handle);
  width: var(--rail-handle);
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(19px, 2.4vw, 38px) 0;
  border: 0;
  border-left: 1px solid var(--divider);
  color: #fff6de;
  text-decoration: none;
  background: linear-gradient(165deg,#4a4c3bcf,#152c24e6), url('/gallery/domek-salon.jpg') 49% center / auto 100%;
}
.booking-rail .rail-handle--pitch {
  order: 2;
  background: linear-gradient(165deg,#56594ac9,#25372de8), url('/gallery/teren.jpg') 65% center / auto 100%;
}
.rail-handle[aria-expanded="true"] { box-shadow: inset 0 3px var(--gold); }
.rail-number { font-weight: 600; font-size: 12px; letter-spacing: .14em; color: var(--gold); }
.rail-spine { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font: 400 clamp(24px,2.05vw,35px)/1 var(--serif,Georgia,serif); }
.rail-panel {
  order: 1;
  width: 0;
  overflow: hidden;
  background: linear-gradient(145deg, rgb(46 55 42 / .90), rgb(21 43 35 / .95)), url('/gallery/domek-salon.jpg') 55% center / cover;
  transition: width 290ms cubic-bezier(.2,.72,.2,1);
}
.booking-rail[data-open="pitch"] .rail-panel {
  background-image: linear-gradient(145deg,rgb(54 64 47 / .88),rgb(24 43 35 / .96)),url('/gallery/teren.jpg');
}
.booking-rail[data-open] .rail-panel { width: var(--panel-width); }
.rail-form {
  width: var(--panel-width);
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: clamp(16px,2.2vw,34px) clamp(14px,1.65vw,26px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: safe center;
  gap: 12px;
  text-align: left;
  color: var(--pale);
  color-scheme: dark;
}
.rail-heading { position: relative; margin: 0 0 1px; }
.booking-rail .rail-kind { margin: 0 34px 5px 0; max-width: none; font: 600 10px/1.3 var(--sans,system-ui,sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.booking-rail .rail-heading h2 { color: var(--pale); margin: 0; font: 400 clamp(30px,2.5vw,40px)/1.04 var(--serif,Georgia,serif); letter-spacing: -.02em; }
.booking-rail .rail-close { position: absolute; top: -10px; right: -9px; width: 40px; height: 40px; padding: 0; background: transparent; border: 0; font: 300 24px/1 Arial,sans-serif; color: var(--gold); }
.rail-dates { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--divider); }
.rail-dates button { min-height: 50px; min-width: 0; padding: 7px 10px; color: var(--pale); background: rgba(5,23,16,.26); text-align: left; border: 0; }
.rail-dates button + button { border-left: 1px solid var(--divider); }
.rail-dates button[aria-pressed="true"] { background: rgb(242 220 171 / .12); box-shadow: inset 0 -2px var(--gold); }
.rail-dates span, .rail-dates strong { display: block; }
.rail-dates span { color: var(--gold); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.rail-dates strong { margin-top: 2px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.rail-month { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 3px; }
.rail-month button { height: 36px; border: 0; color: var(--gold); background: transparent; font: 25px/1 Georgia,serif; }
.rail-month button:disabled { opacity: .3; }
.rail-month select { width: 100%; height: 37px; min-width: 0; padding: 0 2px; border: 0; background: transparent; text-align: center; text-align-last: center; color: var(--pale); font-size: 15px; font-weight: 600; }
.rail-month option { color: #15382e; background: #fff9e9; }
.rail-week, .rail-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); text-align: center; }
.rail-week { color: var(--gold); font-size: 11px; padding: 3px 0 4px; }
.rail-days { grid-template-rows: repeat(6,clamp(30px,2.5vw,36px)); }
.rail-days button { border: 0; border-radius: 0; padding: 0; background: transparent; color: var(--pale); font-size: 14px; line-height: 1; }
.rail-days button:disabled { color: rgb(255 249 233 / .34); }
.rail-days button[data-between] { background: rgb(231 207 158 / .15); color: var(--pale); }
.rail-days button[data-endpoint] { background: var(--gold); color: #17392e; font-weight: 700; }
.rail-days button[aria-current="date"] { text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) {
  .rail-days button:not(:disabled):not([data-endpoint]):hover { background: rgb(231 207 158 / .26); }
  .booking-rail .rail-submit:not(:disabled):hover { background: #f8e6ba; }
}
.booking-rail .rail-status { margin: 0; min-height: 1.4em; color: #eee6cd; font: 400 13px/1.4 var(--sans,system-ui,sans-serif); }
.booking-rail .rail-submit { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 45px; padding: 10px 15px; border: 0; border-radius: 0; background: var(--gold); color: #1b352b; font-weight: 700; font-size: 15px; }
.booking-rail .rail-submit:disabled { background: #cabd9d; color: #394538; }
.booking-rail .rail-submit:focus-visible, .rail-days button[data-endpoint]:focus-visible { outline-color: #274638; }
@media (max-width: 690px) {
  .booking-stage { --rail-handle: 44px; }
  .booking-stage > .shell.hero { min-height: 540px; margin-left: var(--margin); margin-right: calc(var(--rail-handle) + 12px); }
  .hero.booking-stage .hero-copy { max-width: calc(100% - var(--rail-handle)); }
  .booking-rail { display: grid; grid-template-columns: auto var(--rail-handle); grid-template-rows: 1fr 1fr; --panel-width: min(330px,calc(100vw - var(--rail-handle) - var(--rail-safe))); }
  .booking-rail .rail-handle { grid-column: 2; grid-row: 1; padding: 16px 0; }
  .booking-rail .rail-handle--pitch { grid-row: 2; border-top: 1px solid var(--divider); }
  .rail-spine { font-size: 22px; }
  .booking-rail .rail-panel { grid-column: 1; grid-row: 1 / 3; }
  .rail-form { gap: 11px; }
  .rail-days { grid-template-rows: repeat(6,35px); }
}
@media (prefers-reduced-motion: reduce) { .rail-panel { transition: none; } }
@media print { .booking-rail { display: none; } }
