:root {
  --bg: #1a0b14;
  --bg-card: rgba(30, 12, 24, 0.85);
  --accent: #e91e8c;
  --accent-soft: rgba(233, 30, 140, 0.25);
  --accent-border: rgba(233, 30, 140, 0.65);
  --text: #fff;
  --text-muted: rgba(255, 255, 255, 0.65);
  --input-bg: rgba(0, 0, 0, 0.35);
  --disabled: rgba(255, 255, 255, 0.22);
}

* { box-sizing: border-box; }

.chilli-app {
  min-height: 100vh;
  background: linear-gradient(165deg, #2a0f1f 0%, #1a0b14 45%, #120810 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 6px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(26, 11, 20, 0.98) 70%, rgba(26, 11, 20, 0));
}

.nav-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: -4px 0 -4px -4px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.nav-back:active {
  background: rgba(255, 255, 255, 0.08);
}

.nav-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}

.page-body {
  padding-bottom: 8px;
}

.done-header h1 {
  margin: 0;
  font-size: 20px;
}

.chilli-app:has(.slots-screen) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.page-body:has(.slots-screen) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.slots-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.slots-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

.chilli-header { padding: 16px 16px 8px; }
.chilli-header.compact { padding: 10px 12px 4px; flex-shrink: 0; }
.chilli-header h1 { margin: 0; font-size: 22px; font-weight: 700; }
.chilli-header.compact h1 { font-size: 17px; }
.chilli-subtitle { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.price-tariffs {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(233, 30, 140, 0.25);
}
.price-tariffs.compact {
  margin-top: 6px;
  padding: 8px 10px;
}
.tariff-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}
.price-tariffs.compact .tariff-title {
  margin-bottom: 6px;
  font-size: 12px;
}
.tariff-group + .tariff-group { margin-top: 8px; }
.price-tariffs.compact .tariff-group + .tariff-group { margin-top: 6px; }
.tariff-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.tariff-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.price-tariffs.compact .tariff-row { font-size: 11px; line-height: 1.4; }
.tariff-row span:last-child {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.tariff-meta {
  margin: 8px 0 0;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}
.price-tariffs.compact .tariff-meta {
  margin-top: 6px;
  padding-top: 4px;
  font-size: 10px;
}
.lead-hint.compact { margin: 4px 0 0; font-size: 11px; }
.venue-address { margin: 8px 0 0; font-size: 14px; font-weight: 500; }
.venue-address.compact { margin: 6px 0 0; font-size: 12px; }
.venue-map-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 6px 0 0;
  padding: 0;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: #6eb6ff;
  text-decoration: none;
  cursor: pointer;
}
.venue-map-link.compact {
  margin: 4px 0 0;
  font-size: 12px;
}
.lead-hint { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; }
.venue-desc { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); line-height: 1.4; }

.venue-gallery {
  position: relative;
  margin-top: 12px;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
  color: rgba(255, 255, 255, 0.28);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.gallery-prev { left: 4px; }
.gallery-next { right: 4px; }

@media (hover: hover) and (pointer: fine) {
  .gallery-arrow {
    display: flex;
    opacity: 0.35;
  }

  .venue-gallery:hover .gallery-arrow {
    opacity: 0.45;
  }

  .gallery-arrow:hover {
    background: rgba(0, 0, 0, 0.42);
    color: rgba(255, 255, 255, 0.88);
    opacity: 1;
  }
}

.venue-gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: 12px;
}

.venue-gallery-track::-webkit-scrollbar {
  display: none;
}

.venue-gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.venue-gallery-slide img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.venue-gallery-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.chilli-header.compact .venue-gallery-slide img {
  height: 140px;
}

.chilli-header.compact .venue-gallery {
  margin-top: 8px;
}

.chilli-header.compact .venue-gallery-hint {
  display: none;
}

@media (min-width: 480px) {
  .venue-gallery-slide img {
    height: 240px;
  }
}

.booking-page { padding: 0 12px 8px; }

/* Дата */
.date-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.date-bar-icon { font-size: 18px; flex-shrink: 0; }
.date-bar-main { flex: 1; min-width: 0; }
.date-bar-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.date-bar-value { display: block; font-size: 15px; font-weight: 700; }
.date-bar-chevron { color: var(--accent); font-size: 11px; flex-shrink: 0; }

/* Заведение */
.field-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.venue-select-wrap { position: relative; margin-bottom: 10px; }
.venue-select {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--accent-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.venue-select.static { cursor: default; }
.venue-select .pin { opacity: 0.9; flex-shrink: 0; }
.venue-select-text { flex: 1; min-width: 0; line-height: 1.3; }
.venue-select .chevron { color: var(--accent); font-size: 12px; flex-shrink: 0; }
.venue-dropdown {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  z-index: 50;
  background: #2a1020;
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.venue-option {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}
.venue-option:last-child { border-bottom: none; }
.venue-option.active { background: var(--accent-soft); }
.venue-option-name { font-weight: 600; margin-bottom: 2px; }
.venue-option-addr { font-size: 12px; color: var(--text-muted); }

/* Карточки начало / конец */
.time-range-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.time-card {
  position: relative;
  padding: 8px 10px 10px;
  border-radius: 10px;
  border: 2px solid var(--accent-border);
  background: var(--input-bg);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.time-card.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(233, 30, 140, 0.35);
}
.time-card-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  margin-bottom: 2px;
}
.time-card-day-hint {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  text-transform: none;
  letter-spacing: 0;
}
.time-card-time {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.1;
}
.time-card-time .sep { opacity: 0.5; margin: 0 1px; }
.time-card-time .placeholder { opacity: 0.35; font-size: 18px; }
.time-card:disabled { opacity: 0.45; cursor: not-allowed; }

.time-card-date {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
  opacity: 0.9;
}

.time-card-date.is-next-day {
  font-size: 10px;
}

.time-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 6px;
}

.time-tabs {
  display: flex;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.time-tabs.compact .time-tab {
  padding: 6px 10px;
  font-size: 10px;
}

.time-tab {
  padding: 8px 14px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.time-tab.active {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.time-tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.time-panel {
  margin-bottom: 4px;
}

.hours-grid-ref,
.minutes-grid-ref {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.minutes-grid-ref {
  grid-template-columns: repeat(2, 1fr);
  max-width: 200px;
  margin: 0 auto;
}

.hour-cell,
.minute-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 4px 2px;
  border-radius: 8px;
  border: 1.5px solid var(--accent-border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, background 0.12s;
}

.hour-cell {
  flex-direction: column;
  min-height: 46px;
  padding-bottom: 3px;
}

.hour-cell.available:active,
.minute-cell.available:active {
  transform: scale(0.96);
}

.hour-cell.disabled,
.minute-cell.disabled {
  opacity: 0.35;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.15);
  cursor: not-allowed;
}

.hour-cell.selected,
.minute-cell.selected {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(233, 30, 140, 0.32);
}

.hour-num {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.hour-x {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  opacity: 0.6;
}

.hour-next-day {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 8px;
  font-weight: 700;
  opacity: 0.75;
}

.hour-halves-bar {
  display: flex;
  width: 100%;
  gap: 2px;
  margin-top: 3px;
  padding: 0 4px;
}

.hour-halves-bar .hh {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
}

.hour-halves-bar .hh.free { background: #4caf50; }
.hour-halves-bar .hh.booked { background: #f44336; }
.hour-halves-bar .hh.buffer { background: #ff9800; }
.hour-halves-bar .hh.unavail { background: rgba(255, 255, 255, 0.1); }
.hour-halves-bar .hh.my-start,
.hour-halves-bar .hh.my-end,
.hour-halves-bar .hh.my-range { background: var(--accent); }

.hours-divider {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  padding: 4px 0 2px;
}

.time-prompt { font-size: 13px; margin: 0; font-weight: 500; flex: 1; min-width: 0; }
.time-prompt.scroll-hint {
  margin: 8px 0 6px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Шаги бронирования */
.booking-steps {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}

.booking-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.booking-step.active {
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--accent-border);
}

.booking-step.done {
  color: var(--text);
  opacity: 0.85;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.booking-step.active .step-badge {
  background: var(--accent);
  color: #fff;
}

.time-selected-bar {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.time-selected-bar strong {
  color: var(--text);
}

.link-btn {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 0 8px;
  text-decoration: underline;
}

.field-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.field-hint.warn-hint {
  color: #ffb4b4;
}

.field-hint.empty-hint {
  padding: 16px 8px;
  text-align: center;
}

.req {
  color: #ff8a8a;
}

/* Плитки времени (компактнее прежней сетки) */
.time-tiles-wrap {
  margin-bottom: 8px;
}

.time-tile-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.time-tile-grid.duration-tiles {
  grid-template-columns: repeat(4, 1fr);
}

.time-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 5px 2px;
  border-radius: 8px;
  border: 1.5px solid var(--accent-border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}

.time-tile.duration-tile {
  min-height: 34px;
  font-size: 12px;
}

.time-tile:active {
  transform: scale(0.96);
}

.time-tile.selected {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(233, 30, 140, 0.32);
}

.time-end-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.silence-hint-inline {
  margin: 6px 0 0;
  padding: 0 2px;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
}

/* Нижняя панель слотов */
.slots-footer {
  flex-shrink: 0;
  padding: 8px 12px max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(18, 8, 16, 0.98);
}
.slots-summary {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: center;
}
.slots-footer .submit-btn {
  width: 100%;
  margin: 0;
}

/* Календарь */
.calendar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.calendar-modal {
  background: var(--accent);
  border-radius: 4px;
  padding: 20px 16px 16px;
  width: 100%;
  max-width: 320px;
  color: #fff;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cal-nav {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.9;
}
.calendar-title { text-align: center; flex: 1; }
.calendar-title .month { font-size: 22px; font-weight: 700; display: block; }
.calendar-title .year { font-size: 14px; opacity: 0.9; }
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.35);
  margin-bottom: 10px;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
}
.cal-day:hover:not(.disabled) { background: rgba(255,255,255,0.15); }
.cal-day.active { background: rgba(0,0,0,0.25); font-weight: 700; }
.cal-day.disabled { opacity: 0.35; cursor: not-allowed; }
.cal-empty { aspect-ratio: 1; }
.cal-close {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: rgba(0,0,0,0.2);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

/* Формы и итог */
.form-section { padding: 16px; }
.booking-summary {
  background: var(--input-bg);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 14px;
}
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.form-row input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--accent-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 15px;
}
.duration-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--accent-border);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
}
.chip.active { background: var(--accent); border-color: var(--accent); }
.guests-row { align-items: center; }
.chip-select {
  padding: 8px 10px;
  border-radius: 20px;
  border: 1px solid var(--accent-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  min-width: 58px;
}
.chip-select.active { background: var(--accent); border-color: var(--accent); }

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
  cursor: pointer;
}
.consent-row input { margin-top: 3px; accent-color: var(--accent); }
.consent-row.confirm-consent { opacity: 0.85; cursor: default; }

.price-summary {
  background: var(--input-bg);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 16px;
  margin: 16px;
}
.price-summary .row { display: flex; justify-content: space-between; margin-bottom: 8px; }

.submit-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 24px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.submit-btn.secondary { background: rgba(255,255,255,0.1); border: 1px solid var(--accent-border); }
.error-msg { color: #ff8a8a; padding: 8px 16px; font-size: 14px; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 12px; line-height: 1.4; }
.vk-notice {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.vk-notice.success { border-color: rgba(76, 175, 80, 0.45); }
.vk-notice.warn { border-color: rgba(255, 193, 7, 0.45); }
.price-summary + .submit-btn { margin: 16px; width: calc(100% - 32px); }
.vk-chat-fallback { text-align: center; padding: 0 16px 12px; margin-top: -8px; }
.vk-chat-fallback a { color: var(--accent); text-decoration: underline; }
