:root {
  --bg: #000000;
  --panel: #0B0D0F;
  --panel-2: #111418;
  --text: #FFFFFF;
  --muted: #8B9097;
  --soft: #C7CBD1;
  --line: rgba(255,255,255,.12);
  --accent: #A8EEF1;
  --accent-ink: #041416;
  --danger: #FF6A66;
  --success: #8CF2B2;
  --warning: #FFD166;
  --r: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --dock-h: 70px;
}

* {
  box-sizing: border-box;
}

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

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

button,
input,
textarea {
  font: inherit;
}

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

#app {
  width: min(100%, 520px);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  background:
    radial-gradient(circle at 20% 0%, rgba(168,238,241,.1), transparent 28%),
    linear-gradient(180deg, #000 0%, #050607 100%);
  overflow: hidden;
}

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

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

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

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

.page-header {
  padding: 22px 18px 14px;
}

.page-header h1,
.section-title,
.booking-step h2,
.service-detail-card h2,
.booking-success h2 {
  margin: 0;
  font-family: "Russo One", Inter, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0;
}

.page-header h1 {
  font-size: 24px;
}

.section-title {
  padding: 0 18px 12px;
  font-size: 18px;
}

.loading {
  display: flex;
  justify-content: center;
  padding: 28px 0;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.16);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}

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

.state-card,
.empty-state {
  margin: 0 18px 12px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255,255,255,.04);
  text-align: center;
}

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

.hero {
  min-height: min(460px, 48dvh);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 28px 18px 30px;
  overflow: hidden;
}

#hero-wave {
  position: absolute;
  inset: 20% -8% 18%;
  width: 116%;
  height: 62%;
  pointer-events: none;
}

.hero-logo {
  width: min(76vw, 380px);
  max-height: 190px;
  position: relative;
  z-index: 1;
  object-fit: contain;
}

.hero-meta {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 18px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-meta span {
  border: 1px solid rgba(168,238,241,.22);
  color: rgba(255,255,255,.78);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(168,238,241,.06);
}

.hero-action,
.btn-primary,
.btn-secondary,
.btn-danger,
.action-btn,
.filter-chip {
  min-height: 42px;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.hero-action {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  padding: 0 20px;
  color: var(--accent-ink);
  background: var(--accent);
  font-family: "Russo One", Inter, sans-serif;
  text-transform: uppercase;
}

.btn-primary {
  width: 100%;
  padding: 0 16px;
  color: var(--accent-ink);
  background: var(--accent);
  font-family: "Russo One", Inter, sans-serif;
  text-transform: uppercase;
}

.btn-secondary {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0 14px;
}

.btn-danger {
  background: rgba(255,106,102,.12);
  border: 1px solid rgba(255,106,102,.28);
  color: var(--danger);
  padding: 0 14px;
}

.compact {
  width: auto;
  min-height: 36px;
  font-size: 12px;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled,
.filter-chip:disabled {
  opacity: .38;
  cursor: default;
}

.services-grid {
  display: grid;
  gap: 12px;
  padding: 0 14px;
}

.service-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 132px;
  overflow: hidden;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  cursor: pointer;
}

.service-card:active,
.action-btn:active,
.btn-primary:active,
.btn-secondary:active {
  transform: scale(.985);
}

.service-media {
  background: #08090A url("img/tension-mark-alt.webp") center / cover no-repeat;
}

.service-media.empty {
  background-image: url("img/tension-mark-alt.webp");
}

.service-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 12px 11px;
}

.service-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.service-body h3 {
  margin: 6px 0 12px;
  font-family: "Russo One", Inter, sans-serif;
  font-size: 17px;
  line-height: 1.08;
  text-transform: uppercase;
  letter-spacing: 0;
}

.service-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
}

.service-footer span {
  min-width: 0;
}

.service-footer span:first-child {
  color: #fff;
  white-space: nowrap;
}

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

.assistant-shell {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 14px 12px;
  overflow: hidden;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}

#chat-messages {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 14px 14px 78px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.chat-bubble {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: var(--r);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble.model {
  align-self: flex-start;
  color: var(--text);
  background: rgba(255,255,255,.08);
}

.chat-bubble.user {
  align-self: flex-end;
  color: var(--accent-ink);
  background: var(--accent);
}

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

.chat-typing {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.chat-service-card {
  width: min(290px, 86vw);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}

.chat-service-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

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

.chat-service-card strong {
  display: block;
  font-family: "Russo One", Inter, sans-serif;
  text-transform: uppercase;
  font-size: 15px;
  line-height: 1.1;
}

.chat-service-card span {
  display: block;
  margin: 7px 0 10px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

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

.assistant-composer input {
  flex: 1;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline: none;
  padding: 0 12px;
  font-size: 16px;
}

.assistant-composer input:focus {
  border-color: rgba(168,238,241,.5);
}

.assistant-composer button {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: var(--r);
  color: var(--accent-ink);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.assistant-composer svg {
  width: 18px;
  height: 18px;
}

.history-controls {
  display: grid;
  gap: 8px;
  padding: 0 14px 12px;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  color: var(--soft);
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
  font-size: 12px;
}

.filter-chip.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.booking-card,
.profile-card,
.contacts-card,
.form-card,
.summary-card {
  margin: 0 14px 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255,255,255,.045);
}

.booking-card {
  cursor: pointer;
}

.booking-card-head,
.booking-meta,
.summary-card > div,
.booking-detail > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.booking-card-head {
  margin-bottom: 8px;
}

.booking-card-head > span:first-child,
.booking-meta,
.summary-card span,
.booking-detail span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.booking-card h3 {
  margin: 0 0 8px;
  font-family: "Russo One", Inter, sans-serif;
  font-size: 16px;
  line-height: 1.1;
  text-transform: uppercase;
}

.booking-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
}

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

.booking-detail strong,
.summary-card strong {
  text-align: right;
  font-size: 13px;
}

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

.status-badge {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-badge.pending { color: var(--warning); background: rgba(255,209,102,.12); }
.status-badge.confirmed { color: var(--success); background: rgba(140,242,178,.12); }
.status-badge.in_progress { color: var(--accent); background: rgba(168,238,241,.12); }
.status-badge.completed { color: var(--soft); background: rgba(255,255,255,.08); }
.status-badge.cancelled { color: var(--danger); background: rgba(255,106,102,.12); }

.profile-head {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
}

.profile-head strong {
  font-size: 18px;
}

.profile-head span,
.contacts-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-block {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

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

.form-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text);
  background: rgba(0,0,0,.35);
  padding: 10px 12px;
  outline: none;
  font-size: 16px;
}

.form-input:focus {
  border-color: rgba(168,238,241,.55);
}

.request-input {
  min-height: 156px;
  resize: vertical;
}

.contacts-address {
  font-family: "Russo One", Inter, sans-serif;
  text-transform: uppercase;
  font-size: 17px;
  line-height: 1.18;
}

.contacts-meta {
  margin-top: 8px;
}

.contact-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.contact-actions.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-btn {
  width: 100%;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
  font-size: 12px;
}

.primary-action {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

#dock {
  position: fixed;
  left: 50%;
  bottom: 10px;
  width: min(calc(100% - 20px), 500px);
  height: calc(var(--dock-h) + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
}

.dock-inner {
  height: calc(58px + var(--safe-bottom));
  padding: 6px 6px calc(6px + var(--safe-bottom));
  display: flex;
  align-items: center;
  justify-content: space-around;
  border: 1px solid rgba(168,238,241,.18);
  border-radius: 24px;
  background: rgba(10,12,14,.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(0,0,0,.42);
  pointer-events: auto;
}

.dock-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

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

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

.booking-open #dock {
  display: none;
}

#booking-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
  transition: transform .22s ease, opacity .22s ease;
}

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

.booking-shell {
  width: min(100%, 520px);
  height: 100dvh;
  margin: 0 auto;
  overflow-y: auto;
  background:
    radial-gradient(circle at 80% 0%, rgba(168,238,241,.1), transparent 30%),
    #000;
}

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

.booking-topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 12px 14px 8px;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(14px);
}

.booking-back {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text);
  background: rgba(255,255,255,.05);
  font-weight: 800;
  cursor: pointer;
}

.booking-step {
  flex: 1;
  padding: 8px 0 calc(22px + var(--safe-bottom));
}

.booking-step.animated {
  animation: fadeIn .16s ease;
}

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

.booking-step h2 {
  padding: 0 14px;
  font-size: 22px;
}

.step-subtitle {
  padding: 6px 14px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.service-detail-card {
  margin: 0 14px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255,255,255,.045);
}

.service-detail-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.service-detail-card div {
  padding: 14px;
}

.service-detail-card span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.service-detail-card h2 {
  margin-top: 7px;
  font-size: 24px;
  line-height: 1.05;
}

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

.service-detail-card strong {
  font-size: 15px;
}

.booking-step > .btn-primary {
  width: calc(100% - 28px);
  margin: 0 14px;
}

.calendar-card {
  margin: 0 14px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255,255,255,.045);
}

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

.calendar-head button {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--r);
  color: var(--text);
  background: rgba(255,255,255,.06);
  font-size: 22px;
}

.calendar-head strong {
  text-transform: capitalize;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}

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

.calendar-day {
  aspect-ratio: 1;
  border: none;
  border-radius: var(--r);
  color: var(--text);
  background: rgba(255,255,255,.055);
  font-weight: 800;
}

.calendar-day.today {
  outline: 1px solid rgba(168,238,241,.5);
}

.calendar-day.selected {
  color: var(--accent-ink);
  background: var(--accent);
}

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

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

.time-slot {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text);
  background: rgba(255,255,255,.055);
  font-weight: 900;
}

.time-slot.start,
.time-slot.end {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.time-slot.in-range {
  background: rgba(168,238,241,.16);
}

.time-slot.taken {
  color: var(--danger);
  background: rgba(255,106,102,.08);
}

.time-slot.disabled {
  opacity: .35;
}

.time-summary {
  margin: 0 14px 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255,255,255,.045);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

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

.summary-card {
  display: grid;
  gap: 9px;
}

.summary-total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.terms-box {
  margin: 0 14px 12px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255,255,255,.045);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
}

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

.booking-success {
  min-height: 100dvh;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.success-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  position: relative;
  margin-bottom: 18px;
}

.success-mark::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 10px;
  left: 15px;
  top: 18px;
  border-left: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: rotate(-45deg);
}

.booking-success h2 {
  font-size: 26px;
  line-height: 1.05;
}

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

#dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.72);
}

#dialog-overlay.active {
  display: flex;
}

.confirm-card {
  width: min(360px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}

.confirm-card h2 {
  margin: 0;
  font-family: "Russo One", Inter, sans-serif;
  text-transform: uppercase;
  font-size: 19px;
}

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

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

#toast {
  position: fixed;
  z-index: 400;
  left: 50%;
  bottom: calc(var(--dock-h) + var(--safe-bottom) + 22px);
  transform: translateX(-50%) translateY(12px);
  max-width: min(420px, calc(100% - 28px));
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

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

@media (min-width: 700px) {
  .service-card {
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .service-body h3 {
    font-size: 21px;
  }
}
