:root {
  --page: #fde7f0;
  --page-2: #fbd6e5;
  --card: #fff7fa;
  --white: #ffffff;
  --blush: #fdeef4;
  --pink: #f6a5c4;
  --rose: #e8679a;
  --rose-deep: #c93d74;
  --berry: #8f2d57;
  --text: #5e2440;
  --muted: #a77790;
  --line: #f6c9da;
  --line-soft: #fadbe7;
  --danger: #c2334d;
  --warning: #a8742a;
  --radius: 26px;
  --serif: "Playfair Display", "Times New Roman", serif;
  --script: "Great Vibes", cursive;
  --tabbar-h: 70px;
  --glow: 0 10px 30px rgb(232 103 154 / 18%);
  font-family: Nunito, ui-rounded, 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);
  /* Soft pattern of tiny hearts, diamonds and sparkles, like the logo backdrop. */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23f4b8cf' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M22 30s-8-5-8-10a4 4 0 0 1 8-1.5 4 4 0 0 1 8 1.5c0 5-8 10-8 10z' fill='%23f9cfe0'/%3E%3Cpath d='M78 74h14l5 6-12 13-12-13z'/%3E%3Cpath d='M73 80h24'/%3E%3C/g%3E%3Cg fill='%23f2a9c6'%3E%3Cpath d='M92 18l1.6 4.4L98 24l-4.4 1.6L92 30l-1.6-4.4L86 24l4.4-1.6z'/%3E%3Cpath d='M30 92l1 2.8 2.8 1-2.8 1-1 2.8-1-2.8-2.8-1 2.8-1z'/%3E%3Ccircle cx='58' cy='44' r='1.6'/%3E%3Ccircle cx='108' cy='104' r='1.4'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(1200px 520px at 50% -120px, #fff4f8 0%, transparent 70%);
  background-size: 120px 120px, 100% 100%;
  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: 25px; font-weight: 600; line-height: 1.1; color: var(--rose-deep); }
h3 { font-size: 16px; font-weight: 800; }
svg { width: 1em; height: 1em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---------- Hero ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 4px 20px; }
.hero-eyebrow { color: var(--rose); font-size: 12px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
.hero h1 { margin-top: 4px; color: var(--text); font-size: clamp(26px, 7.6vw, 32px); font-weight: 900; line-height: 1.1; letter-spacing: -0.01em; }
.hero-frame {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--pink), var(--rose-deep));
  box-shadow: 0 6px 18px rgb(201 61 116 / 28%);
}
.hero-crop { display: block; width: 100%; height: 100%; overflow: hidden; border: 2px solid var(--white); border-radius: 50%; background: var(--blush); }
/* The logo is a full illustration: zoom in on the girl's face for the small avatar. */
.hero-logo { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(2.1) translate(1%, -4%); transform-origin: 47% 52%; }

/* ---------- Cards ---------- */
.card {
  position: relative;
  padding: 20px 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--glow);
}
.card + .card { margin-top: 18px; }
/* A little satin bow pinned on top of the main cards. */
.bowed { margin-top: 14px; }
.bowed::before {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 46px;
  height: 28px;
  content: "";
  transform: translateX(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 28'%3E%3Cpath d='M23 13 7 3.6C4.6 2.2 2 3.9 2 6.6v11.8c0 2.7 2.9 4.4 5.2 3L23 15m0-2 16-9.4c2.4-1.4 5 .3 5 3v11.8c0 2.7-2.9 4.4-5.2 3L23 15' fill='%23f9bfd5' stroke='%23e8679a' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='m20.5 16-3 10M25.5 16l3 10' stroke='%23e8679a' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='23' cy='14' r='3.6' fill='%23e8679a'/%3E%3C/svg%3E") center / contain no-repeat;
}

.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; font-weight: 600; }
.section-heading.slim { margin: 20px 2px 10px; }
.section-heading.slim h3 { color: var(--rose-deep); }

.step {
  display: grid;
  flex: 0 0 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: linear-gradient(145deg, var(--pink), var(--rose));
  box-shadow: 0 4px 12px rgb(232 103 154 / 35%);
  font-size: 15px;
  font-weight: 900;
}

/* ---------- 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: 1.5px solid var(--line-soft);
  border-radius: 20px;
  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; }
.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: 5px; }
.service-meta .price { color: var(--rose-deep); font-size: 16px; font-weight: 900; white-space: nowrap; }
.service-meta .duration { padding: 3px 9px; border-radius: 999px; color: var(--rose); background: var(--blush); font-size: 12px; font-weight: 800; white-space: nowrap; }
.service-card.is-selected { border-color: var(--rose); background: linear-gradient(160deg, #fff, var(--blush)); box-shadow: 0 0 0 2px var(--pink), var(--glow); }

/* ---------- Date & time ---------- */
.date-strip { display: flex; gap: 8px; margin: 0 -16px 14px; padding: 2px 16px 8px; overflow-x: auto; scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }
.date-chip {
  display: grid;
  flex: 0 0 auto;
  min-width: 66px;
  gap: 2px;
  padding: 9px 10px;
  border: 1.5px solid var(--line-soft);
  border-radius: 18px;
  text-align: center;
  background: var(--white);
}
.date-chip .dow { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.date-chip .day { font-family: var(--serif); font-size: 25px; font-weight: 600; line-height: 1.05; color: var(--text); }
.date-chip .mon { color: var(--muted); font-size: 11px; font-weight: 700; }
.date-chip .cnt { margin-top: 2px; color: var(--rose); font-size: 10px; font-weight: 900; }
.date-chip.is-selected { border-color: transparent; background: linear-gradient(160deg, var(--pink), var(--rose)); box-shadow: 0 6px 16px rgb(232 103 154 / 35%); }
.date-chip.is-selected * { color: var(--white); }

.compact-field { max-width: 260px; }
.slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.slot-grid .empty-state { grid-column: 1 / -1; }
.slot-button { padding: 12px 4px; border: 1.5px solid var(--line-soft); border-radius: 16px; background: var(--white); font-size: 15px; font-weight: 800; }
.slot-button.is-selected { color: var(--white); border-color: transparent; background: linear-gradient(160deg, var(--pink), var(--rose)); box-shadow: 0 6px 16px rgb(232 103 154 / 35%); }

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

.field { display: grid; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 700; }
.field input, .field textarea, select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  outline: 0;
  color: var(--text);
  background: var(--white);
  font-size: 16px;
}
.field input:focus, .field textarea:focus, select:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgb(246 165 196 / 30%); }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.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(--rose); }

.primary-button, .secondary-button {
  display: block;
  width: 100%;
  padding: 15px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  transition: transform 120ms ease, opacity 120ms ease;
}
.primary-button:active, .secondary-button:active { transform: scale(0.98); }
.primary-button { border: 0; color: var(--white); background: linear-gradient(135deg, #f7a9c7, var(--rose) 60%, var(--rose-deep)); box-shadow: 0 10px 22px rgb(201 61 116 / 30%), 0 1px 0 rgb(255 255 255 / 45%) inset; }
.primary-button:disabled { opacity: 0.6; }
.secondary-button { border: 1.5px solid var(--line); color: var(--rose-deep); background: var(--white); }
.text-button { padding: 6px; border: 0; color: var(--rose-deep); background: transparent; font-weight: 800; text-decoration: underline; }
.danger-button { color: var(--danger); }
.cta-hint { margin-top: 10px; color: var(--muted); font-size: 12.5px; line-height: 1.45; text-align: center; }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  border-top: 1.5px solid var(--line);
  border-radius: 24px 24px 0 0;
  background: rgb(255 245 249 / 92%);
  backdrop-filter: blur(16px);
  box-shadow: 0 -10px 30px rgb(232 103 154 / 16%);
}
.nav-button {
  display: grid;
  flex: 1;
  max-width: 110px;
  justify-items: center;
  gap: 3px;
  padding: 7px 4px;
  border: 0;
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  transition: background 140ms ease, color 140ms ease;
}
.nav-button[hidden] { display: none; }
.nav-button svg { width: 23px; height: 23px; }
.nav-button.is-active { color: var(--rose-deep); background: var(--page-2); }

/* ---------- Lists & admin ---------- */
.stack { display: grid; gap: 10px; }
.list-card, .form-card {
  border: 1.5px solid var(--line-soft);
  border-radius: 20px;
  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(--rose-deep); font-weight: 800; text-underline-offset: 3px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.card-actions button { padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: transparent; font-size: 12px; font-weight: 800; }
.card-actions button.danger-button { color: var(--danger); }

.badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; color: var(--text); background: var(--blush); font-size: 11px; font-weight: 900; white-space: nowrap; }
.badge.confirmed { color: var(--white); background: var(--rose); }
.badge.pending { color: var(--warning); background: #fff1d9; }
.card-actions button.accent-button { color: var(--white); border-color: transparent; background: var(--rose); }

.duration-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.duration-chips button { padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--rose-deep); background: var(--blush); font-size: 13px; font-weight: 800; }
.duration-chips button:active { transform: scale(0.96); }
.end-hint { min-height: 18px; margin: 0 2px 12px; color: var(--rose-deep) !important; font-size: 13px; font-weight: 800; }
.badge.cancelled { color: var(--danger); background: color-mix(in srgb, var(--danger) 11%, white); }
.badge.completed { color: var(--muted); }
.badge.inactive { color: var(--warning); background: color-mix(in srgb, var(--warning) 13%, white); }
.source-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; color: var(--muted); background: var(--blush); font-size: 11px; font-weight: 800; }

.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(--rose-deep); font-size: 13px; font-weight: 900; }
.booking-date-count { display: inline-grid; min-width: 24px; height: 24px; place-items: center; padding: 0 7px; border-radius: 999px; color: var(--white); background: var(--rose); font-size: 11px; }
.booking-date-items { display: grid; gap: 10px; }

.form-card { padding: 16px; margin-bottom: 16px; box-shadow: var(--glow); }
.form-card h3 { margin-bottom: 14px; color: var(--rose-deep); }
.form-card p { color: var(--muted); font-size: 13px; }
.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(--white); background: linear-gradient(135deg, var(--pink), var(--rose) 70%, var(--rose-deep)); box-shadow: var(--glow); }
.admin-hero h2 { color: var(--white); }
.admin-hero .eyebrow { margin-bottom: 4px; font-size: 11px; font-weight: 900; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.9; }
.subnav { display: flex; gap: 4px; margin: 12px 0 16px; padding: 4px; overflow-x: auto; scrollbar-width: none; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); }
.subnav::-webkit-scrollbar { display: none; }
.subnav-button { flex: 1; min-width: max-content; padding: 9px 13px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 800; }
.subnav-button.is-active { color: var(--white); background: var(--rose); }
.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 { line-height: 1.45; }
.availability-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.availability-summary { margin: -4px 2px 12px; color: var(--rose-deep); font-size: 13px; font-weight: 800; }
.availability-day { display: grid; gap: 12px; }
.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 11px; border-radius: 999px; background: var(--blush); font-size: 13px; font-weight: 800; }

.empty-state { padding: 26px 16px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 20px; background: rgb(255 255 255 / 55%); font-size: 14px; font-weight: 600; line-height: 1.45; }

.app-footer { display: grid; justify-items: center; gap: 8px; padding: 28px 0 6px; }
.footer-gem { width: 22px; height: 22px; color: var(--pink); }
.social-link { color: var(--rose-deep); font-size: 13px; font-weight: 800; text-decoration: none; border-bottom: 1.5px solid var(--pink); padding-bottom: 2px; }

.notice { margin-bottom: 14px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 18px; 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: 999px;
  color: var(--white);
  background: var(--berry);
  box-shadow: 0 10px 30px rgb(143 45 87 / 35%);
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.skeleton-grid::before, .skeleton-grid::after { content: ""; display: block; height: 78px; border-radius: 20px; background: linear-gradient(90deg, var(--white), var(--blush), 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, .field-row { grid-template-columns: 1fr; }
}

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