:root {
  --page: #545454;
  --page-deep: #464546;
  --dot: #f4cfdc;
  --paper: #f3f1f0;
  --paper-2: #e7e4e3;
  --white: #fffdfc;
  --text: #2c2a2b;
  --muted: #76716f;
  --on-page: #faf7f6;
  --on-page-muted: #d9d3d2;
  --ink: #3b393a;
  --rose: #e9a8bd;
  --rose-deep: #a8506e;
  --rose-soft: #f8e3ea;
  --border: rgb(44 42 43 / 11%);
  --danger: #b03a4b;
  --warning: #8a6420;
  --radius: 20px;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --tabbar-h: 66px;
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page);
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html, body { touch-action: pan-x pan-y; overscroll-behavior: none; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--page);
  background-image:
    radial-gradient(circle, var(--dot) 1.7px, transparent 2.3px),
    radial-gradient(circle, var(--dot) 1.7px, transparent 2.3px);
  background-size: 34px 26px;
  background-position: 0 0, 17px 13px;
  background-attachment: fixed;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, figure { margin: 0; }
h2 { font-family: var(--serif); font-size: 27px; font-weight: 600; line-height: 1.05; letter-spacing: -0.01em; }
h3 { font-size: 16px; font-weight: 750; }
svg { width: 1em; height: 1em; }

.app-shell {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 18px 12px 22px;
  text-align: center;
  color: var(--on-page);
}
.hero-eye { display: block; width: 74px; height: 46px; margin: 0 auto 2px; color: var(--rose); opacity: 0.95; }
.hero-title { display: flex; align-items: center; justify-content: center; gap: 12px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(42px, 13vw, 58px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 18px rgb(0 0 0 / 25%);
}
.sparkles { color: var(--rose); font-size: 13px; letter-spacing: 4px; white-space: nowrap; }
.hero-sub { margin-top: 6px; color: var(--on-page); font-size: 13px; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; }
.hero-tagline { margin-top: 10px; color: var(--on-page-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.hero-tagline span { margin: 0 4px; color: var(--rose); }

/* ---------- Paper cards with tape, like the brand posters ---------- */
.paper {
  position: relative;
  padding: 18px 16px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 1px 0 rgb(255 255 255 / 60%) inset, 0 16px 40px rgb(0 0 0 / 28%);
}
.paper + .paper, .paper + .success-card { margin-top: 16px; }
.taped::before, .taped::after {
  position: absolute;
  top: -10px;
  width: 78px;
  height: 22px;
  content: "";
  background: rgb(255 255 255 / 55%);
  box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
  backdrop-filter: blur(2px);
}
.taped::before { left: 18px; transform: rotate(-7deg); }
.taped::after { right: 18px; transform: rotate(6deg); }

.view { display: none; animation: rise 260ms ease both; }
.view.is-active { display: block; }
.admin-view { display: none; }
.admin-view.is-active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-heading p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.section-heading.slim { margin: 20px 0 10px; }
.section-heading.on-dark h3 { color: var(--on-page); }

.step {
  display: grid;
  flex: 0 0 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

/* ---------- Services ---------- */
.service-list { display: grid; gap: 10px; }
.service-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: left;
  background: var(--white);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.service-card:active { transform: scale(0.985); }
.service-card h3 { grid-column: 1; font-size: 16px; }
.service-card p { grid-column: 1; color: var(--muted); font-size: 13px; line-height: 1.4; }
.service-meta { display: grid; grid-column: 2; grid-row: 1 / span 2; align-content: center; justify-items: end; gap: 4px; }
.service-meta .price { font-size: 16px; font-weight: 800; white-space: nowrap; }
.service-meta .duration { padding: 3px 8px; border-radius: 999px; color: var(--muted); background: var(--paper-2); font-size: 12px; font-weight: 700; white-space: nowrap; }
.service-card.is-selected { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.service-card.is-selected .price { color: var(--rose-deep); }

/* ---------- Date & time ---------- */
.date-strip { display: flex; gap: 8px; margin: 0 -16px 14px; padding: 2px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }
.date-chip {
  display: grid;
  flex: 0 0 auto;
  min-width: 64px;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
  background: var(--white);
}
.date-chip .dow { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.date-chip .day { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1; }
.date-chip .mon { color: var(--muted); font-size: 11px; font-weight: 600; }
.date-chip .cnt { margin-top: 2px; color: var(--rose-deep); font-size: 10px; font-weight: 800; }
.date-chip.is-selected { color: var(--white); border-color: var(--ink); background: var(--ink); }
.date-chip.is-selected .dow, .date-chip.is-selected .mon { color: var(--on-page-muted); }
.date-chip.is-selected .cnt { color: var(--rose); }

.compact-field { max-width: 260px; }
.slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.slot-button { padding: 12px 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--white); font-size: 15px; font-weight: 750; }
.slot-button.is-selected { color: var(--white); border-color: var(--ink); background: var(--ink); }

/* ---------- Summary & forms ---------- */
.summary-card { padding: 4px 14px; margin-bottom: 16px; border-radius: 14px; background: var(--white); border: 1px solid var(--border); }
.summary-line { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed rgb(44 42 43 / 16%); font-size: 14px; }
.summary-line:last-child { border-bottom: 0; }
.summary-line span:first-child { color: var(--muted); }
.summary-line strong { text-align: right; }

.field { display: grid; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 650; }
.field input, .field textarea, select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  outline: 0;
  color: var(--text);
  background: var(--white);
  font-size: 16px;
}
.field input:focus, .field textarea:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgb(59 57 58 / 10%); }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-hint { color: var(--muted); font-size: 12px; font-weight: 500; }
.check-field { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 18px; font-size: 14px; line-height: 1.4; }
.check-field input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--ink); }
.check-field a { color: var(--rose-deep); font-weight: 750; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.primary-button, .secondary-button {
  display: block;
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  transition: transform 120ms ease, opacity 120ms ease;
}
.primary-button:active, .secondary-button:active { transform: scale(0.985); }
.primary-button { border: 0; color: var(--white); background: var(--ink); box-shadow: 0 8px 20px rgb(0 0 0 / 18%); }
.primary-button:disabled { opacity: 0.6; }
.secondary-button { border: 1px solid var(--border); color: var(--text); background: var(--white); }
.text-button { padding: 6px; border: 0; background: transparent; font-weight: 750; text-decoration: underline; }
.danger-button { color: var(--danger); }

/* ---------- Success ---------- */
.success-card { text-align: center; }
.success-card .check { display: grid; width: 58px; height: 58px; margin: 4px auto 12px; place-items: center; border-radius: 50%; color: var(--rose); background: var(--ink); font-size: 26px; }
.success-card h2 { margin-bottom: 8px; font-size: 32px; }
.success-card > p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.success-card .summary-card { margin: 16px 0; text-align: left; }

/* ---------- Posters (rules / directions images) ---------- */
.poster { position: relative; }
.poster-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--page-deep);
  box-shadow: 0 18px 44px rgb(0 0 0 / 35%);
}
.poster-open img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; }
.zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--white);
  background: rgb(44 42 43 / 72%);
  backdrop-filter: blur(6px);
  font-size: 12px;
  font-weight: 700;
}
.poster-cta { margin-top: 16px; }
.address-card { margin-top: 16px; }
.address-line { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; font-weight: 700; line-height: 1.4; }
.address-line svg { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; color: var(--rose-deep); }
.address-note { margin: 6px 0 0 32px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.map-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }

.lightbox {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
  overflow: auto;
  background: rgb(20 19 20 / 92%);
  animation: fade 160ms ease;
}
.lightbox[hidden] { display: none; }
.lightbox img { width: 100%; max-width: 720px; height: auto; border-radius: 14px; }
.lightbox-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: var(--white);
  font-size: 17px;
  font-weight: 800;
}
@keyframes fade { from { opacity: 0; } }

/* ---------- Guest banner ---------- */
.guest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 11px 12px 11px 15px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 16px;
  color: var(--on-page);
  background: rgb(44 42 43 / 70%);
  backdrop-filter: blur(8px);
  font-size: 13px;
  line-height: 1.4;
}
.guest-banner a { flex: 0 0 auto; padding: 8px 12px; border-radius: 11px; color: var(--text); background: var(--white); font-size: 13px; font-weight: 800; text-decoration: none; }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: rgb(59 57 58 / 94%);
  backdrop-filter: blur(14px);
  box-shadow: 0 -8px 28px rgb(0 0 0 / 25%);
}
.nav-button {
  display: grid;
  flex: 1;
  max-width: 110px;
  justify-items: center;
  gap: 3px;
  padding: 7px 4px;
  border: 0;
  border-radius: 12px;
  color: var(--on-page-muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}
.nav-button[hidden] { display: none; }
.nav-button svg { width: 22px; height: 22px; }
.nav-button.is-active { color: var(--white); background: rgb(255 255 255 / 10%); }
.nav-button.is-active svg { color: var(--rose); }

/* ---------- Lists & admin ---------- */
.stack { display: grid; gap: 10px; }
.list-card, .form-card, .info-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--white);
}
.list-card { padding: 15px; }
.list-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.list-card p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.telegram-user-link, .phone-link { color: var(--text); font-weight: 800; text-underline-offset: 3px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.card-actions button { padding: 8px 11px; border: 1px solid var(--border); border-radius: 10px; background: transparent; font-size: 12px; font-weight: 750; }
.card-actions button.danger-button { color: var(--danger); }

.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: var(--text); background: var(--paper-2); font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.confirmed { color: var(--rose-deep); background: var(--rose-soft); }
.badge.cancelled { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.badge.completed { color: var(--muted); }
.badge.inactive { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.source-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; color: var(--muted); background: var(--paper-2); font-size: 11px; font-weight: 750; }

.booking-date-group { display: grid; gap: 9px; }
.booking-date-group + .booking-date-group { margin-top: 10px; }
.booking-date-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 2px; color: var(--on-page); font-size: 13px; font-weight: 800; }
.booking-date-count { display: inline-grid; min-width: 24px; height: 24px; place-items: center; padding: 0 7px; border-radius: 999px; color: var(--text); background: var(--rose); font-size: 11px; }
.booking-date-items { display: grid; gap: 10px; }
#view-my-bookings .booking-date-heading { color: var(--text); }

.form-card { padding: 16px; margin-bottom: 16px; }
.form-card h3 { margin-bottom: 14px; }
.form-title-row, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-hero { padding: 18px; border-radius: var(--radius); color: var(--on-page); background: rgb(44 42 43 / 82%); }
.admin-hero .eyebrow { margin-bottom: 4px; color: var(--rose); font-size: 11px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; }
.subnav { display: flex; gap: 4px; margin: 12px 0 16px; padding: 4px; overflow-x: auto; scrollbar-width: none; border-radius: 14px; background: rgb(44 42 43 / 70%); }
.subnav::-webkit-scrollbar { display: none; }
.subnav-button { flex: 1; min-width: max-content; padding: 9px 12px; border: 0; border-radius: 10px; color: var(--on-page-muted); background: transparent; font-size: 13px; font-weight: 700; }
.subnav-button.is-active { color: var(--text); background: var(--white); }
.toolbar { margin-bottom: 12px; }
.toolbar select { flex: 1; }
.toolbar button { width: auto; }

.availability-head { display: grid; gap: 14px; }
.availability-head h3 { margin-bottom: 5px; }
.availability-head p { color: var(--muted); font-size: 13px; line-height: 1.45; }
.availability-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.availability-summary { margin: -4px 2px 12px; color: var(--on-page); font-size: 13px; font-weight: 750; }
.availability-day { display: grid; gap: 12px; }
.availability-day-head h3 { font-size: 16px; }
.availability-day-head p { margin-top: 3px; }
.availability-times { display: flex; flex-wrap: wrap; gap: 8px; }
.availability-time { display: inline-flex; align-items: center; min-height: 36px; padding: 8px 10px; border-radius: 11px; background: var(--paper-2); font-size: 13px; font-weight: 800; }

.empty-state { padding: 26px 16px; text-align: center; color: var(--muted); border: 1px dashed rgb(44 42 43 / 22%); border-radius: 16px; font-size: 14px; line-height: 1.45; }
#view-admin .empty-state, #admin-slot-list .empty-state { color: var(--on-page-muted); border-color: rgb(255 255 255 / 25%); }

.app-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; padding: 26px 0 6px; }
.social-link { color: var(--on-page); font-size: 13px; font-weight: 700; text-decoration: none; border-bottom: 1px solid rgb(244 207 220 / 55%); padding-bottom: 2px; }

.notice { margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; color: var(--danger); background: var(--white); font-size: 13px; }
.toast {
  position: fixed;
  z-index: 60;
  right: 16px;
  bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom));
  left: 16px;
  max-width: 480px;
  margin: auto;
  padding: 13px 15px;
  border-radius: 14px;
  color: var(--white);
  background: #262425;
  box-shadow: 0 10px 34px rgb(0 0 0 / 35%);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.skeleton-grid::before, .skeleton-grid::after { content: ""; display: block; height: 78px; border-radius: 16px; background: linear-gradient(90deg, var(--white), var(--paper-2), var(--white)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 400px) {
  .slot-grid { grid-template-columns: repeat(3, 1fr); }
  .availability-actions, .map-actions, .field-row { grid-template-columns: 1fr; }
  .sparkles { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
