: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;
}

.chilli-header { padding: 16px 16px 8px; }
.chilli-header h1 { margin: 0; font-size: 22px; font-weight: 700; }
.chilli-subtitle { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; }
.venue-address { margin: 8px 0 0; font-size: 14px; font-weight: 500; }
.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-photos { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.venue-photos img { width: 100px; height: 68px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }

.booking-page { padding: 0 16px 24px; }

/* Заведение */
.field-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.venue-select-wrap { position: relative; margin-bottom: 16px; }
.venue-select {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--accent-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 15px;
  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: 10px;
  margin-bottom: 16px;
}
.time-card {
  position: relative;
  padding: 14px 12px 18px;
  border-radius: 12px;
  border: 2px solid var(--accent-border);
  background: var(--input-bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.time-card.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(233, 30, 140, 0.35);
}
.time-card.active::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--accent);
}
.time-card-label { font-size: 12px; opacity: 0.85; margin-bottom: 4px; }
.time-card-date {
  font-size: 13px;
  margin-bottom: 8px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.time-card-date.is-next-day {
  text-decoration: none;
}
.time-card-next-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-right: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}
.time-card-time {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
}
.time-card-time .sep { opacity: 0.5; margin: 0 2px; }
.time-card-time .placeholder { opacity: 0.35; }
.time-card:disabled { opacity: 0.45; cursor: not-allowed; }

.time-prompt { font-size: 15px; margin: 20px 0 12px; font-weight: 500; }

/* Вкладки ЧАСЫ / МИНУТЫ */
.time-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 0;
}
.time-tab {
  padding: 12px;
  border: none;
  background: rgba(0,0,0,0.25);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 12px 12px 0 0;
}
.time-tab.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.time-tab:disabled { opacity: 0.4; cursor: not-allowed; }

.time-panel {
  background: rgba(255,255,255,0.06);
  border-radius: 0 0 14px 14px;
  padding: 14px;
  min-height: 200px;
}

/* Сетка часов */
.hours-grid-ref {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.hour-cell-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.hour-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 10px 6px;
  border-radius: 10px;
  border: 2px solid var(--accent-border);
  background: rgba(0,0,0,0.2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.hour-cell:active:not(:disabled) { transform: scale(0.96); }
.hour-cell.available { border-color: var(--accent-border); }
.hour-cell.selected {
  background: var(--accent);
  border-color: var(--accent);
}
.hour-cell.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255,255,255,0.12);
}
.hour-halves-bar {
  display: flex;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 4px 0 2px;
  gap: 1px;
}
.hour-halves-bar .hh { flex: 1; min-width: 0; }
.hour-halves-bar .hh.free { background: rgba(255,255,255,0.2); }
.hour-halves-bar .hh.booked { background: #c62828; }
.hour-halves-bar .hh.buffer { background: #6d4c41; }
.hour-halves-bar .hh.my-start,
.hour-halves-bar .hh.my-end,
.hour-halves-bar .hh.my-range { background: var(--accent); }
.hour-halves-bar .hh.unavail { background: rgba(255,255,255,0.08); }

/* Лента дня */
.day-timeline-wrap { margin: 16px 0 4px; }
.day-timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.day-timeline-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.day-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}
.tl-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.tl-dot.my-range { background: var(--accent); }
.tl-dot.booked { background: #c62828; }
.tl-dot.buffer { background: #6d4c41; }
.day-timeline {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.tl-slot {
  flex: 0 0 8px;
  height: 28px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
}
.tl-slot.free { background: rgba(255,255,255,0.15); }
.tl-slot.booked { background: #c62828; }
.tl-slot.buffer { background: #6d4c41; }
.tl-slot.my-start,
.tl-slot.my-end,
.tl-slot.my-range { background: var(--accent); }
.tl-slot.unavail { background: rgba(255,255,255,0.06); }

.minute-cell.my-range,
.minute-cell.my-start,
.minute-cell.my-end { background: var(--accent); border-color: var(--accent); }
.minute-cell.booked,
.minute-cell.buffer,
.minute-cell.unavail { opacity: 0.35; }
.minute-cell.picking { box-shadow: 0 0 0 2px #fff; }

.hour-num { font-size: 26px; font-weight: 700; line-height: 1; }
.hour-next-day {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 8px;
  font-weight: 600;
  opacity: 0.65;
  letter-spacing: 0.02em;
}
.silence-hint {
  margin: 0;
  padding: 0 2px 2px;
  font-size: 9px;
  line-height: 1.25;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}
.minutes-grid-ref .silence-hint {
  grid-column: 1 / -1;
  margin-top: 6px;
  font-size: 10px;
}
.hour-unit { font-size: 10px; margin-top: 4px; opacity: 0.85; text-transform: lowercase; }
.hour-x {
  position: absolute;
  top: 4px; right: 6px;
  font-size: 11px;
  opacity: 0.7;
}

/* Сетка минут — только 00 и 30 */
.minutes-grid-ref {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 220px;
  margin: 0 auto;
}
.minute-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid var(--accent-border);
  background: rgba(0,0,0,0.2);
  color: var(--text);
  cursor: pointer;
}
.minute-cell.selected { background: var(--accent); border-color: var(--accent); }
.minute-cell.disabled { opacity: 0.3; cursor: not-allowed; }
.minute-num { font-size: 32px; font-weight: 700; }
.minute-unit { font-size: 10px; margin-top: 4px; letter-spacing: 0.05em; opacity: 0.85; }

.minutes-hint { text-align: center; color: var(--text-muted); font-size: 14px; padding: 40px 16px; }

/* Календарь */
.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; }
