:root {
  --bg: #222222;
  --bg-deep: #171717;
  --panel: rgba(36, 38, 41, 0.94);
  --panel-solid: #27292c;
  --panel-soft: rgba(225, 227, 230, 0.06);
  --text: #E1E3E6;
  --text-soft: rgba(225, 227, 230, 0.68);
  --muted: rgba(225, 227, 230, 0.42);
  --border: rgba(225, 227, 230, 0.1);
  --accent: #71AAEB;
  --accent-soft: rgba(113, 170, 235, 0.14);
  --danger: #ff6b6b;
  --warning: #f6b34d;
  --success: #6fd08c;
  --radius: 14px;
  --dock: 70px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

#wave-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #222222;
}

#app {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#pages {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px calc(var(--dock) + var(--safe-bottom) + 22px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  scrollbar-width: none;
}

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

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

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

.page-head.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
}

.page-head h2,
.section-head h2,
.booking-step h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.05;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.subhead {
  margin: 18px 2px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.loading {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(225, 227, 230, 0.12);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.65s linear infinite;
}

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

.hero {
  min-height: min(58vh, 440px);
  padding: calc(34px + var(--safe-top)) 4px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
}

.hero-mark {
  width: min(54vw, 230px);
  aspect-ratio: 1.3 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 20px rgba(225, 227, 230, 0.28));
}

.hero-logo {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.hero-copy {
  display: grid;
  gap: 6px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 11vw, 58px);
  line-height: 0.92;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.hero-action,
.btn-primary,
.btn-secondary,
.btn-danger {
  min-height: 44px;
  border-radius: 999px;
  border: 0;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  cursor: pointer;
}

.hero-action,
.btn-primary {
  color: #0d1722;
  background: var(--accent);
  box-shadow: 0 10px 34px rgba(113, 170, 235, 0.22);
}

.btn-secondary {
  color: var(--text);
  background: rgba(225, 227, 230, 0.05);
  border: 1px solid var(--border);
}

.btn-danger {
  color: var(--danger);
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.18);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.42;
  cursor: default;
  box-shadow: none;
}

.compact {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 8px 0;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

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

.service-card {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  cursor: pointer;
}

.service-card:active {
  transform: scale(0.985);
}

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

.service-card.disabled:active {
  transform: none;
}

.service-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #111;
  overflow: hidden;
}

.service-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.44));
  pointer-events: none;
}

.service-media img,
.service-detail-card > img,
.chat-service-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.service-body {
  min-height: 112px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-height: 18px;
}

.service-topline span,
.detail-category {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.service-topline strong {
  max-width: 64%;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.2;
  text-align: right;
}

.service-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.08;
  font-weight: 900;
  text-transform: uppercase;
}

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

.assistant-shell {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(23, 23, 23, 0.82);
}

.chat-messages {
  height: 100%;
  overflow-y: auto;
  padding: 14px 14px 88px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1.45;
}

.chat-bubble.model {
  align-self: flex-start;
  color: var(--text);
  background: rgba(225, 227, 230, 0.08);
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  align-self: flex-end;
  color: #0d1722;
  background: var(--accent);
  border-bottom-right-radius: 4px;
}

.chat-typing {
  color: var(--muted);
  font-size: 13px;
}

.chat-message-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.chat-service-card {
  width: min(280px, 100%);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-solid);
}

.chat-service-card img {
  height: 132px;
}

.chat-service-card div {
  padding: 10px;
}

.chat-service-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-service-card p {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 12px;
}

.assistant-composer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 10px calc(10px + var(--safe-bottom));
  display: flex;
  gap: 8px;
  background: rgba(23, 23, 23, 0.94);
  border-top: 1px solid var(--border);
}

.assistant-composer input,
.form-input {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(225, 227, 230, 0.06);
  color: var(--text);
  outline: none;
  font-size: 16px;
}

.assistant-composer input:focus,
.form-input:focus {
  border-color: rgba(113, 170, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(113, 170, 235, 0.1);
}

.form-input::placeholder,
.assistant-composer input::placeholder {
  color: var(--muted);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn.send {
  color: #0d1722;
  background: var(--accent);
}

.page-content {
  display: grid;
  gap: 10px;
}

.info-panel,
.booking-card,
.summary-card,
.state-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.info-panel {
  padding: 14px;
  display: grid;
  gap: 13px;
}

.profile-identity {
  display: grid;
  gap: 3px;
  padding-bottom: 4px;
}

.profile-identity strong {
  font-size: 18px;
  line-height: 1.15;
  font-weight: 900;
}

.profile-identity span,
.field-block span,
.contact-block span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.field-block {
  display: grid;
  gap: 7px;
}

.textarea {
  resize: vertical;
  min-height: 142px;
}

.state-card {
  min-height: 150px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.state-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.booking-card {
  padding: 13px;
  cursor: pointer;
}

.booking-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.booking-row h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 900;
  text-transform: uppercase;
}

.booking-row p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.35;
}

.status-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-badge.pending { color: var(--warning); background: rgba(246, 179, 77, 0.12); }
.status-badge.confirmed { color: var(--success); background: rgba(111, 208, 140, 0.12); }
.status-badge.in_progress { color: var(--accent); background: var(--accent-soft); }
.status-badge.completed { color: var(--text-soft); background: rgba(225, 227, 230, 0.08); }
.status-badge.cancelled { color: var(--danger); background: rgba(255, 107, 107, 0.1); }

.booking-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
}

.booking-detail div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.booking-detail span {
  color: var(--muted);
}

.booking-detail strong {
  text-align: right;
}

.booking-detail p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.contacts-panel {
  gap: 16px;
}

.contact-block {
  display: grid;
  gap: 5px;
}

.contact-block strong {
  font-size: 15px;
  line-height: 1.35;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 80;
  width: min(520px, 100%);
  transform: translateX(-50%);
  padding: 0 12px calc(10px + var(--safe-bottom));
  pointer-events: none;
}

.dock-inner {
  min-height: var(--dock);
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(23, 23, 23, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: auto;
}

.dock-item {
  min-width: 0;
  flex: 1;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}

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

.dock-item span {
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 800;
}

.dock-item.active {
  color: var(--accent);
  background: rgba(113, 170, 235, 0.1);
}

body.assistant-input-mode #dock,
body.booking-open #dock {
  opacity: 0;
  pointer-events: none;
}

#booking-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

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

.booking-shell {
  width: min(520px, 100%);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow-y: auto;
  padding: 0 16px calc(22px + var(--safe-bottom));
}

.booking-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: calc(10px + var(--safe-top)) 0 8px;
  background: linear-gradient(180deg, var(--bg) 76%, rgba(34, 34, 34, 0));
}

.booking-step {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
}

.booking-step-animated {
  animation: fade-in 0.16s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.step-subtitle {
  margin: -4px 0 2px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.35;
}

.service-detail-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
}

.service-detail-card > img {
  height: min(54vh, 390px);
}

.service-detail-card > div {
  padding: 14px;
  display: grid;
  gap: 9px;
}

.service-detail-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.04;
  font-weight: 900;
  text-transform: uppercase;
}

.service-detail-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.service-detail-card strong {
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
}

.calendar {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-header button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(225, 227, 230, 0.05);
  color: var(--text);
  cursor: pointer;
}

.cal-header strong {
  text-transform: capitalize;
  font-size: 14px;
}

.cal-weekdays,
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.cal-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.cal-days {
  gap: 3px;
}

.cal-day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.cal-day.selected {
  background: var(--accent);
  color: #0d1722;
  font-weight: 900;
}

.cal-day:disabled {
  opacity: 0.24;
  cursor: default;
}

.cal-day.empty {
  pointer-events: none;
}

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

.slot {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.slot.start,
.slot.end {
  background: var(--accent);
  color: #0d1722;
  border-color: var(--accent);
}

.slot.in-range {
  background: var(--accent-soft);
  border-color: rgba(113, 170, 235, 0.28);
}

.slot:disabled,
.slot.disabled {
  opacity: 0.28;
  cursor: default;
}

.summary-strip,
.terms-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.summary-strip {
  min-height: 48px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.summary-strip strong {
  color: var(--accent);
}

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

.summary-card {
  padding: 13px;
  display: grid;
  gap: 10px;
}

.summary-card > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

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

.summary-card strong {
  text-align: right;
}

.summary-card .total {
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 16px;
  font-weight: 900;
}

.summary-card .total strong {
  color: var(--accent);
}

.terms-box {
  padding: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.terms-box input {
  margin-top: 1px;
  accent-color: var(--accent);
}

.booking-success {
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.success-mark {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #0d1722;
  font-size: 32px;
  font-weight: 900;
}

.booking-success h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.05;
  font-weight: 900;
  text-transform: uppercase;
}

.booking-success p {
  max-width: 280px;
  margin: 0 0 6px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

#dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

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

.dialog-card {
  width: min(350px, 100%);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-solid);
  text-align: center;
}

.dialog-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.dialog-card p {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.dialog-actions {
  display: flex;
  gap: 8px;
}

.dialog-actions > * {
  flex: 1;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock) + var(--safe-bottom) + 18px);
  z-index: 260;
  max-width: min(430px, calc(100% - 30px));
  transform: translateX(-50%) translateY(14px);
  opacity: 0;
  pointer-events: none;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--accent);
  color: #0d1722;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.18s ease;
}

#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 359px) {
  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-body {
    min-height: 0;
  }

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

@media (min-width: 720px) {
  #app,
  .booking-shell,
  #dock {
    max-width: 620px;
  }

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

  .service-detail-card > img {
    height: 440px;
  }
}
