:root {
  color-scheme: light;
  --bg: #F5F6FA;
  --text: #172033;
  --hint: #404A5E;
  --link: #4F46E5;
  --btn: #4F46E5;
  --btn-text: #FFFFFF;
  --accent: #4F46E5;
  --secondary-bg: #FFFFFF;
  --header-bg: #FFFFFF;
  --section-bg: #FFFFFF;
  --section-header: #667085;
  --subtitle: #667085;
  --separator: #E4E7EC;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-2: #EEF0FF;
  --bottom-bar: rgba(255, 255, 255, 0.58);
  --input-gradient: #FFFFFF;
  --positive: #18794E;
  --destructive: #B42318;
  --app-accent-soft: #EEF0FF;
  --app-accent-outline: #4F46E5;
  --app-danger-soft: #FDECEC;
  --app-danger-line: #B42318;
  --font-display: 'Manrope', sans-serif;
  --font-text: 'Manrope', sans-serif;
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 12px 28px rgba(23, 32, 51, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  --shadow-card: 0 10px 24px rgba(23, 32, 51, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  appearance: none;
}

.app {
  min-height: 100dvh;
}

.shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding:
    calc(14px + env(safe-area-inset-top, 0px))
    16px
    calc(96px + env(safe-area-inset-bottom, 0px));
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-card,
.surface-card,
.studio-card,
.appt-card,
.choice-card,
.summary-card,
.date-card,
.slot-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-card);
}

.hero-card,
.surface-card {
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
}

.hero-card {
  padding: 22px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.surface-card {
  padding: 18px;
}

.hero-topline,
.section-head,
.choice-title-row,
.appt-topline,
.confirm-row,
.profile-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.hero-topline,
.section-head {
  align-items: flex-start;
}

.section-head.tight {
  margin-bottom: 8px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--section-header);
}

.hero-title,
.section-title,
.studio-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}

.hero-title {
  font-size: clamp(2.15rem, 9vw, 3.2rem);
  max-width: 12ch;
  margin-top: 6px;
}

.section-title {
  font-size: 1.7rem;
  margin-top: 6px;
}

.hero-copy,
.section-copy,
.studio-copy,
.choice-note,
.error-copy,
.info-line {
  margin: 0;
  color: var(--subtitle);
}

.hero-copy {
  max-width: 34ch;
  margin-top: 10px;
}

.hero-pills,
.chip-row,
.choice-meta,
.step-chips,
.date-strip,
.slot-grid,
.filters,
.studio-grid,
.choice-list,
.appt-list,
.summary-grid {
  display: flex;
  gap: 10px;
}

.hero-pills,
.chip-row,
.choice-meta {
  flex-wrap: wrap;
}

.hero-pills {
  margin-top: 14px;
}

.hero-pills.compact {
  margin-top: 12px;
}

.hero-pill,
.micro-pill,
.filter-chip {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.hero-pill,
.micro-pill {
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--hint);
}

.filter-chip {
  border: 1px solid var(--separator);
  background: var(--secondary-bg);
  color: var(--hint);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.filter-chip.active,
.summary-card.ready,
.step-chip.active,
.date-card.active,
.slot-card.active,
.choice-card.selected {
  border-color: var(--accent);
  background: var(--app-accent-soft);
  color: var(--accent);
}

.primary-btn,
.ghost-btn {
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}

.primary-btn {
  align-self: flex-start;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-text);
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.28);
}

.primary-btn:active {
  transform: scale(0.97);
}

.ghost-btn {
  padding: 10px 14px;
  border: 1px solid var(--separator);
  border-radius: 999px;
  background: var(--secondary-bg);
  font-weight: 700;
  color: var(--hint);
}

.ghost-btn.danger {
  color: var(--destructive);
  border-color: var(--app-danger-line);
  background: var(--app-danger-soft);
}

.filters {
  flex-direction: column;
  margin-top: 18px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
}

.field-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  background: var(--input-gradient);
  outline: none;
  appearance: none;
}

.field-input::placeholder {
  color: #9AA3B2;
}

.field-input:focus {
  border-color: var(--app-accent-outline);
  box-shadow: 0 0 0 4px var(--app-accent-soft);
}

.field-input-textarea {
  resize: vertical;
  min-height: 88px;
}

.studio-grid,
.choice-list,
.appt-list {
  flex-direction: column;
  margin-top: 16px;
}

.studio-card,
.choice-card,
.appt-card {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.studio-card:active,
.choice-card:active,
.appt-card:active {
  transform: scale(0.985);
}

.studio-card {
  overflow: hidden;
}

.studio-card:hover,
.choice-card:hover,
.appt-card:hover {
  border-color: rgba(79, 70, 229, 0.34);
}

.studio-cover,
.detail-cover {
  min-height: 140px;
  background:
    linear-gradient(180deg, rgba(23, 32, 51, 0.04), rgba(23, 32, 51, 0.1)),
    linear-gradient(135deg, #EEF0FF, #DFE3FF);
  background-position: center;
  background-size: cover;
}

.studio-card-body,
.choice-card,
.appt-card {
  padding: 16px;
}

.studio-card-topline,
.subsection-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.studio-name {
  margin-top: 10px;
  font-size: 1.7rem;
}

.studio-category,
.studio-arrow {
  font-size: 13px;
  font-weight: 800;
  color: var(--hint);
}

.studio-arrow {
  font-size: 20px;
  color: var(--accent);
}

.studio-copy {
  margin-top: 10px;
}

.booking-card {
  overflow: hidden;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 16px;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--btn);
  transition: width 0.28s ease;
}

.step-chips {
  overflow-x: auto;
  padding-bottom: 4px;
  margin-top: 16px;
}

.step-chip {
  min-width: 112px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--separator);
  background: var(--secondary-bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: none;
}

.step-chip.done .step-index {
  color: var(--accent);
}

.step-chip.done {
  background: var(--app-accent-soft);
  border-color: rgba(79, 70, 229, 0.34);
}

.step-index {
  font-size: 12px;
  font-weight: 800;
  color: var(--section-header);
}

.step-label,
.summary-label {
  font-size: 12px;
  color: var(--hint);
}

.summary-grid {
  flex-wrap: wrap;
  margin-top: 16px;
}

.summary-card {
  flex: 1 1 calc(50% - 8px);
  min-width: 132px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  text-align: left;
  color: var(--text);
}

.summary-card.jumpable:enabled {
  cursor: pointer;
}

.summary-value {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
}

.step-panel {
  margin-top: 18px;
}

.subsection + .subsection {
  margin-top: 18px;
}

.subsection-title,
.choice-title,
.appt-title {
  margin: 0;
  font-size: 1rem;
}

.subsection-note,
.choice-meta,
.appt-copy {
  color: var(--hint);
  font-size: 13px;
}

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

.choice-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.choice-price {
  font-weight: 800;
  color: var(--accent);
}

.avatar-badge,
.empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #EEF0FF, #DFE3FF);
  background-size: cover;
  background-position: center;
  font-weight: 800;
  color: var(--accent);
  flex: none;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 12px;
  text-align: center;
  color: var(--hint);
}

.empty-state.compact {
  padding: 16px 8px;
}

.date-strip {
  overflow-x: auto;
  padding-bottom: 4px;
  margin-top: 14px;
}

.date-card,
.slot-card {
  min-width: 110px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  text-align: left;
  color: var(--text);
  flex: none;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.date-card:hover,
.slot-card:hover {
  border-color: rgba(79, 70, 229, 0.34);
}

.date-title {
  display: block;
  font-weight: 800;
}

.date-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--hint);
}

.slot-grid {
  flex-wrap: wrap;
  margin-top: 14px;
}

.slot-card {
  min-width: calc(33.333% - 8px);
  text-align: center;
  font-weight: 800;
}

.confirm-sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.confirm-row {
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--separator);
}

.appt-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-new,
.status-confirmed {
  background: var(--app-accent-soft);
  color: var(--accent);
}

.status-cancelled_by_client,
.status-cancelled_by_studio {
  background: var(--app-danger-soft);
  color: var(--destructive);
}

.profile-card {
  gap: 16px;
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
}

.profile-head {
  align-items: center;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 62px;
  height: 62px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--accent);
  background: linear-gradient(135deg, #EEF0FF, #DFE3FF);
  flex: none;
}

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transform: translateY(-100%);
  padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
  background: var(--destructive);
  color: #ffffff;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.24s ease;
}

.offline-banner.show {
  transform: translateY(0);
}

.toast-wrap {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  padding: 12px 16px;
  border-radius: 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  box-shadow: 0 6px 22px rgba(23, 32, 51, 0.16);
  animation: toast-in 0.22s ease;
}

.toast-item.success {
  background: var(--positive);
  color: #ffffff;
}

.toast-item.error {
  background: var(--destructive);
  color: #ffffff;
}

.toast-item.info {
  background: rgba(23, 32, 51, 0.92);
  color: #fff;
}

.toast-item.out {
  animation: toast-out 0.18s ease forwards;
}

.tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 1200;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: var(--bottom-bar);
  backdrop-filter: blur(22px) saturate(1.18);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  box-shadow: 0 16px 34px rgba(23, 32, 51, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.92), inset 0 -1px 0 rgba(255, 255, 255, 0.36);
}

.tabbar-btn {
  min-height: 46px;
  padding: 12px 10px;
  border-radius: 17px;
  font-size: 13px;
  font-weight: 800;
  color: var(--hint);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.tabbar-btn.active {
  background: #FFFFFF;
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(23, 32, 51, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.skel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-2);
}

.skel::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmer 1.4s infinite;
}

.skel-kicker { width: 96px; height: 14px; background: #E4E7EC; }
.skel-title { width: 70%; height: 44px; margin-top: 12px; background: #E4E7EC; }
.skel-line { width: 88%; height: 16px; margin-top: 12px; background: #E4E7EC; }
.skel-block { width: 100%; height: 96px; background: #E4E7EC; }
.skel-cover { width: 100%; height: 160px; border-radius: 22px; background: linear-gradient(135deg, #EEF0FF, #DFE3FF); }
.skel-chip { width: 112px; height: 54px; border-radius: 18px; background: #E4E7EC; }

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px) scale(0.98); }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 1.95rem;
  }

  .slot-card {
    min-width: calc(50% - 6px);
  }

  .summary-card {
    min-width: 100%;
  }
}
