:root {
  --bg: #0d1220;
  --panel: #151d30;
  --panel-2: #1b2540;
  --line: #263250;
  --text: #eef2ff;
  --muted: #93a0bf;
  --accent: #6c8cff;
  --accent-2: #8f6cff;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 20% -10%, #1b2a52 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100%;
}

body {
  padding: max(12px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
}

.app {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.boot {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 18px;
}

.brand span {
  color: var(--accent);
}

.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
}

.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

/* Контакты поддержки — второстепенный блок, не конкурирует с записью. */
.support {
  border-style: dashed;
}

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

.hero {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.avatar {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.hero h1 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.15;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.stars {
  color: var(--warn);
}

.service-list,
.booking-list,
.exception-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}

.service.active {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.12);
}

.service input {
  accent-color: var(--accent);
}

.service .grow {
  flex: 1;
}

.service .title {
  font-weight: 600;
}

.service .price {
  font-weight: 700;
  white-space: nowrap;
}

.selection {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.mode.active {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.12);
}

.mode input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.mode .title {
  display: block;
  font-weight: 600;
}

.mode .muted {
  display: block;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.gallery-item {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.gallery-item .btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.separate-service {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.separate-service:last-child {
  margin-bottom: 0;
}

.separate-service .dates {
  margin-bottom: 8px;
}

.dates {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.date {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: center;
  min-width: 64px;
}

.date.active {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.16);
}

.date .dow {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
}

.date .num {
  display: block;
  font-weight: 700;
  font-size: 15px;
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
}

.slot {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 6px;
  cursor: pointer;
  font-weight: 600;
}

.slot.active {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.18);
}

label.field {
  display: block;
  margin-bottom: 10px;
}

label.field span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

input[type="text"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: #0e1526;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

textarea {
  min-height: 74px;
  resize: vertical;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.btn.small {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.btn.danger {
  background: rgba(248, 113, 113, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #ffd7d7;
}

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

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
}

.tab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  font: inherit;
  font-size: 13px;
}

.tab.active {
  color: #fff;
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.18);
}

.booking {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.booking .when {
  font-weight: 700;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.pending {
  background: rgba(251, 191, 36, 0.16);
  color: var(--warn);
}

.badge.confirmed {
  background: rgba(52, 211, 153, 0.16);
  color: var(--good);
}

.badge.completed {
  background: rgba(108, 140, 255, 0.16);
  color: #b9c8ff;
}

.badge.negative {
  background: rgba(248, 113, 113, 0.14);
  color: #ffb4b4;
}

.qr-box {
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  margin: 6px auto 12px;
  width: min(280px, 100%);
}

.qr-box img {
  width: 100%;
  height: auto;
  display: block;
}

.copyline {
  display: flex;
  gap: 8px;
}

.copyline input {
  flex: 1;
  min-width: 0;
}

.weekday {
  display: grid;
  grid-template-columns: 44px 1fr 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.weekday .name {
  font-size: 13px;
  color: var(--muted);
}

.empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.success {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.08);
}

.notice {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #0b1020;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  max-width: min(92vw, 520px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  z-index: 20;
  font-size: 14px;
}

.toast.bad {
  border-color: rgba(248, 113, 113, 0.6);
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 0 2px;
}

.footer button {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0 2px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

a {
  color: var(--accent);
}

.user-chip {
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 420px) {
  body {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .brand {
    font-size: 16px;
  }

  .chip {
    padding: 7px 10px;
    font-size: 12px;
  }

  .card {
    padding: 13px;
  }

  .row {
    flex-wrap: wrap;
  }

  .user-chip {
    max-width: 55vw;
  }
}
