:root {
  --bg: #1f1f1f;
  --bg-elevated: #252525;
  --bg-soft: #2b2b2b;
  --bg-muted: #171717;
  --text: #f2f2f2;
  --text-soft: rgba(242, 242, 242, 0.72);
  --text-dim: rgba(242, 242, 242, 0.5);
  --accent: #e6e6e6;
  --accent-strong: #ffffff;
  --accent-fade: rgba(230, 230, 230, 0.14);
  --border: rgba(255, 255, 255, 0.08);
  --danger: #ff7f7f;
  --success: #8fda8f;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.34);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --dock-height: 76px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(180deg, #232323 0%, #1f1f1f 22%, #181818 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.18;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

#app {
  position: relative;
  width: min(100%, 520px);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
}

#pages {
  position: relative;
  height: 100%;
}

.page {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.page.active {
  opacity: 1;
  pointer-events: auto;
}

.page-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--dock-height) + var(--safe-bottom) + 22px);
}

.page-scroll::-webkit-scrollbar,
.booking-shell::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.page-head,
.section-head {
  padding: calc(18px + var(--safe-top)) 20px 14px;
}

.section-head {
  padding-top: 0;
}

.page-title,
.section-title,
.hero-note,
.booking-service-name,
.step-title,
.dialog-card h2 {
  font-family: 'Unbounded', sans-serif;
}

.page-title,
.section-title {
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.section-note,
.page-note,
.booking-copy,
.service-card-meta,
.history-empty p,
.empty-card p {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.hero {
  position: relative;
  min-height: 45vh;
  margin: 0 0 18px;
  padding: calc(28px + var(--safe-top)) 20px 26px;
  border-radius: 0 0 34px 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #222 0%, #191919 100%);
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#hero-wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.82;
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
}

.hero-logo {
  width: min(72vw, 280px);
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.34));
}

.hero-note {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(242, 242, 242, 0.62);
  text-align: center;
}

.hero-cta,
.btn-primary,
.btn-secondary,
.btn-danger,
.dialog-btn,
.ghost-btn {
  min-height: 46px;
  border-radius: 999px;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.hero-cta,
.btn-primary,
.dialog-btn.primary {
  background: var(--accent);
  color: #171717;
  padding: 0 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  width: 100%;
}

.btn-secondary,
.dialog-btn.secondary,
.ghost-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0 18px;
  font-weight: 700;
}

.btn-danger,
.dialog-btn.danger {
  background: rgba(255, 127, 127, 0.12);
  color: var(--danger);
  padding: 0 18px;
  font-weight: 700;
}

.hero-cta:active,
.btn-primary:active,
.btn-secondary:active,
.btn-danger:active,
.dialog-btn:active,
.ghost-btn:active,
.service-card:active,
.dock-item:active,
.action-card:active,
.icon-btn:active {
  transform: scale(0.98);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled,
.icon-btn:disabled {
  opacity: 0.42;
}

.catalog-section {
  padding: 0 16px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
}

.service-card {
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.service-card.disabled {
  opacity: 0.56;
  cursor: default;
}

.service-card-media-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: var(--bg-soft);
  aspect-ratio: 1 / 1.18;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
}

.service-card-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}

.service-card-media-wrap::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.service-card-disabled-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(242, 242, 242, 0.76);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.service-card-body {
  display: grid;
  gap: 4px;
  padding: 0 2px;
}

.service-card-price {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent-strong);
}

.service-card-name {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.service-card-meta {
  font-size: 11px;
  color: var(--text-dim);
}

.assistant-page {
  display: flex;
  flex-direction: column;
}

.assistant-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 6px;
}

.chat-bubble,
.chat-service-card,
.panel,
.summary-card,
.profile-card,
.booking-card,
.action-card,
.dialog-card,
.empty-card,
.assistant-composer {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(37, 37, 37, 0.94);
  box-shadow: var(--shadow);
}

.chat-bubble {
  max-width: 86%;
  padding: 13px 14px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: #171717;
  border-color: transparent;
}

.chat-bubble.model {
  align-self: flex-start;
  color: var(--text);
}

.chat-message-group {
  display: grid;
  gap: 10px;
}

.chat-service-card {
  overflow: hidden;
}

.chat-service-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}

.chat-service-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.chat-service-name {
  font-size: 15px;
  font-weight: 800;
}

.chat-service-price {
  color: var(--text-soft);
  font-size: 13px;
}

.assistant-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  margin-bottom: 4px;
}

.assistant-composer input,
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #171717;
  color: var(--text);
  outline: none;
}

.form-textarea {
  min-height: 150px;
  padding: 14px;
  resize: none;
}

.assistant-composer input::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(242, 242, 242, 0.34);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus,
.assistant-composer input:focus {
  border-color: rgba(230, 230, 230, 0.26);
}

.icon-btn {
  width: 46px;
  min-width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent);
  color: #171717;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.loading,
.history-empty,
.empty-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.empty-card,
.history-empty {
  margin: 0 16px;
  padding: 26px 18px;
}

.loading {
  padding: 42px 0;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.history-section {
  display: grid;
  gap: 10px;
  padding: 0 16px;
}

.history-section + .history-section {
  margin-top: 18px;
}

.history-label {
  padding: 0 4px;
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.booking-card {
  padding: 14px;
}

.booking-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.booking-card-title {
  font-size: 15px;
  font-weight: 800;
}

.booking-card-subtitle,
.booking-card-meta,
.booking-detail-row span:first-child {
  color: var(--text-soft);
}

.booking-card-subtitle {
  margin-top: 4px;
  font-size: 12px;
}

.booking-card-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 12px;
}

.booking-status {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.booking-status.pending {
  background: rgba(255, 210, 127, 0.14);
  color: #ffd27f;
}

.booking-status.confirmed {
  background: rgba(143, 218, 143, 0.16);
  color: var(--success);
}

.booking-status.in_progress {
  background: rgba(230, 230, 230, 0.14);
  color: var(--accent);
}

.booking-status.completed {
  background: rgba(120, 200, 255, 0.14);
  color: #9ed1ff;
}

.booking-status.cancelled {
  background: rgba(255, 127, 127, 0.14);
  color: var(--danger);
}

.booking-card-detail {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.booking-detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.booking-detail-row strong,
.summary-value,
.booking-detail-comment {
  color: var(--text);
}

.booking-detail-comment {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-muted);
  font-size: 13px;
  line-height: 1.55;
}

.booking-actions,
.dialog-actions,
.button-row {
  display: flex;
  gap: 10px;
}

.booking-actions > *,
.dialog-actions > *,
.button-row > * {
  flex: 1;
}

.profile-card {
  margin: 0 16px 12px;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.profile-username {
  font-size: 15px;
  font-weight: 800;
}

.profile-meta {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 13px;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.contacts-grid {
  display: grid;
  gap: 12px;
  padding: 0 16px;
}

.action-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.action-card-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.action-card-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}

.action-card-copy {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.action-card-cta {
  margin-top: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0 16px calc(var(--safe-bottom) + 12px);
  pointer-events: none;
}

.dock-inner {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  min-height: var(--dock-height);
  padding: 8px;
  border-radius: 26px;
  background: rgba(23, 23, 23, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.dock-item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 58px;
  padding: 6px 2px;
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dock-item svg {
  width: 20px;
  height: 20px;
}

.dock-item span {
  max-width: 100%;
  line-height: 1.2;
  text-align: center;
}

.dock-item.active {
  color: var(--bg);
  background: var(--accent);
}

.booking-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: #1f1f1f;
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.booking-overlay.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.booking-shell {
  height: 100%;
  overflow-y: auto;
}

.booking-step-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.booking-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(16px + var(--safe-top)) 18px 14px;
  background: rgba(31, 31, 31, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.booking-topbar-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.booking-step {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px 16px calc(var(--safe-bottom) + 28px);
}

.step-title {
  font-size: 17px;
  line-height: 1.2;
}

.step-subtitle {
  margin-top: -8px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.summary-card,
.service-detail-card {
  padding: 16px;
}

.service-detail-card {
  display: grid;
  gap: 14px;
}

.booking-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: 18px;
  filter: grayscale(1) contrast(1.06);
}

.booking-service-name {
  font-size: 22px;
  line-height: 1.15;
}

.booking-copy {
  font-size: 14px;
}

.booking-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
}

.booking-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.calendar {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(37, 37, 37, 0.94);
  box-shadow: var(--shadow);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.calendar-head strong {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.calendar-nav {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays {
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 44px;
  border-radius: 14px;
  background: #171717;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
  font-weight: 700;
}

.calendar-day.empty {
  visibility: hidden;
}

.calendar-day.disabled {
  opacity: 0.2;
}

.calendar-day.today {
  border-color: rgba(230, 230, 230, 0.24);
}

.calendar-day.selected {
  background: var(--accent);
  color: #171717;
  border-color: transparent;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.time-slot {
  min-height: 48px;
  padding: 0 8px;
  border-radius: 15px;
  background: rgba(37, 37, 37, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.time-slot.boundary {
  background: #171717;
  color: var(--text-dim);
}

.time-slot.taken,
.time-slot.past,
.time-slot.range-blocked {
  opacity: 0.28;
}

.time-slot.selected,
.time-slot.in-range {
  background: rgba(230, 230, 230, 0.14);
  border-color: rgba(230, 230, 230, 0.22);
}

.time-slot.selected {
  color: var(--accent);
}

.time-slot.in-range {
  color: rgba(242, 242, 242, 0.86);
}

.time-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  font-size: 13px;
}

.time-summary strong {
  color: var(--text);
}

.summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.summary-row + .summary-row {
  margin-top: 10px;
}

.summary-label {
  color: var(--text-soft);
}

.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 16px;
  font-weight: 800;
}

.terms-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(37, 37, 37, 0.94);
  box-shadow: var(--shadow);
}

.checkbox-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.checkbox-row span {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.success-card {
  display: grid;
  gap: 14px;
  padding: 24px 18px;
  text-align: center;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(230, 230, 230, 0.12);
  color: var(--accent);
}

.success-card h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 18px;
  line-height: 1.25;
}

.success-card p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.dialog-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dialog-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.dialog-card {
  width: min(100%, 380px);
  padding: 22px 18px 18px;
}

.dialog-card h2 {
  font-size: 18px;
  line-height: 1.25;
}

.dialog-card p {
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}

.dialog-actions {
  margin-top: 18px;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--dock-height) + var(--safe-bottom) + 18px);
  transform: translate(-50%, 16px);
  min-width: 160px;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #171717;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 95;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 560px) {
  .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .time-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
