:root {
      --indigo-50: #eef2ff;
      --indigo-100: #e0e7ff;
      --indigo-200: #c7d2fe;
      --indigo-300: #a5b4fc;
      --indigo-400: #818cf8;
      --indigo-500: #6366f1;
      --indigo-600: #4f46e5;
      --indigo-700: #4338ca;
      --indigo-800: #3730a3;
      --indigo-900: #312e81;
      --bg: #0b0c10;
      --text: #0f172a;
      --muted: #64748b;
      --card: #ffffff;
      --ring: rgba(99, 102, 241, 0.4);
      --shadow: 0 10px 25px rgba(2, 6, 23, 0.12), 0 8px 10px rgba(2, 6, 23, 0.06);
    }

    * { box-sizing: border-box; }
    html, body { height: 100%; }
    body {
      margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
      color: var(--text); background: linear-gradient(135deg, var(--indigo-50), #f8fafc);
    }

    .container {
      width: 100%; max-width: none; margin: 0; padding: 16px;
      min-height: 100vh; display: flex; flex-direction: column;
    }

    .header {
      display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px;
    }
    .brand {
      display: flex; align-items: center; gap: 12px;
    }
    .logo {
      width: 40px; height: 40px; border-radius: 50%;
      background: linear-gradient(135deg, var(--indigo-600), var(--indigo-400));
      box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
      display: grid; place-items: center;
      font-size: 24px; line-height: 1; overflow: hidden;
      aspect-ratio: 1 / 1;
      flex: 0 0 auto;
    }
    .logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
    @media (max-width: 700px) {
      .logo { width: 36px; height: 36px; font-size: 20px; }
    }
    h1 { font-size: 24px; margin: 0; color: var(--indigo-900); }
    .subtitle { margin: 0; color: var(--muted); font-size: 14px; }

    .app {
      display: grid; grid-template-columns: 1fr; gap: 22px; flex: 1;
    }

    .card {
      background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
      overflow: hidden; border: 1px solid #e5e7eb;
      display: flex; flex-direction: column; min-height: 0;
    }
    .content { flex: 1; display: block; }

    .stepper-wrapper {
      /* For sticky stepper on mobile */
      position: relative;
    }
    @media (max-width: 700px) {
      .stepper-wrapper {
        position: sticky;
        top: 0;
        z-index: 10;
        background: rgba(255, 255, 255, 0.85);
        -webkit-backdrop-filter: saturate(180%) blur(8px);
        backdrop-filter: saturate(180%) blur(8px);
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 4px 12px rgba(2, 6, 23, 0.06);
      }
    }

    .stepper {
      display: flex; gap: 10px; padding: 14px; background: linear-gradient(180deg, var(--indigo-50), #fff); border-bottom: 1px solid #e5e7eb;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-x: contain;
      scrollbar-width: none;
      -ms-overflow-style: none;
      scroll-behavior: smooth;
    }
    .stepper::-webkit-scrollbar { display: none; }
    @media (max-width: 700px) {
      .stepper {
        gap: 6px;
        padding: 8px 4px 8px 4px;
        border-radius: 0 0 12px 12px;
        min-width: 0;
      }
    }

    .step {
      flex: 1; display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px dashed #e5e7eb;
      color: var(--muted); background: #fff; min-width: 150px;
      transition: border .2s, background .2s, color .2s;
    }
    @media (max-width: 700px) {
      .step {
        min-width: 200px;
        padding: 10px 10px;
        font-size: 12px;
        gap: 8px;
        align-items: start;
      }
    }
    /* Prevent text overflow inside step cards */
    .step > div:last-child { min-width: 0; }
    .step .label, .step .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .step.active {
      border: 1px solid var(--indigo-300); background: linear-gradient(180deg, #fff, var(--indigo-50)); color: var(--indigo-800); box-shadow: 0 4px 14px rgba(99, 102, 241, 0.1);
    }
    .step .badge { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--indigo-600); box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35) }
    .step .label { font-size: 13px; font-weight: 600; }
    .step .hint { font-size: 11px; color: var(--muted); margin-top: 1px; }
    @media (max-width: 700px) {
      .step .label { font-size: 12px; line-height: 1.25; white-space: normal; overflow: visible; text-overflow: clip; }
      .step .hint { font-size: 11px; white-space: normal; overflow: visible; text-overflow: clip; }
      .step .badge { width: 24px; height: 24px; font-size: 13px; }
    }

    .content { padding: 18px; }
    @media (max-width: 700px) {
      .content {
        padding: 10px 4px 88px 4px; /* extra bottom padding for sticky bottom nav */
      }
    }

    .services {
      display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
    }
    @media (max-width: 700px) {
      .services {
        grid-template-columns: 1fr;
        gap: 10px;
      }
    }

    .service {
      border: 1px solid #e5e7eb; border-radius: 14px; padding: 14px; cursor: pointer; background: #fff; transition: all .2s ease;
    }
    @media (max-width: 700px) {
      .service {
        padding: 10px;
        font-size: 14px;
      }
      .service .desc { font-size: 12px; }
      .service .meta { font-size: 12px; padding: 4px 8px; }
    }
    .service:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(99, 102, 241, 0.12); border-color: var(--indigo-300); }
    .service.selected { border-color: var(--indigo-500); box-shadow: 0 10px 24px rgba(99, 102, 241, 0.16); }
    .service .title { font-weight: 700; color: var(--indigo-900); }
    .service .desc { color: var(--muted); font-size: 13px; margin-top: 6px; }
    .service .meta {
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      gap: 12px;
      margin-top: 10px;
      font-size: 13px;
      font-weight: 600;
      color: var(--indigo-600);
      background: var(--indigo-50);
      padding: 6px 12px;
      border-radius: 8px;
    }

    .field { display: grid; gap: 6px; margin: 12px 0; }
    label { font-size: 13px; color: var(--indigo-900); font-weight: 600; }
    input[type="date"], input[type="text"], input[type="email"], input[type="tel"], textarea, select {
      width: 100%; padding: 12px 12px; border-radius: 12px; border: 1px solid #e5e7eb; background: #fff; outline: none;
      transition: box-shadow .15s ease, border-color .15s ease;
      font-size: 16px;
    }
    @media (max-width: 700px) {
      input[type="date"], input[type="text"], input[type="email"], input[type="tel"], textarea, select {
        font-size: 14px;
        padding: 10px 8px;
      }
    }

    textarea { min-height: 92px; resize: vertical; }
    input:focus, select:focus, textarea:focus { border-color: var(--indigo-400); box-shadow: 0 0 0 4px var(--ring); }
    .error { color: #b91c1c; font-size: 12px; display: none; }

    .time-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    @media (max-width: 700px) {
      .time-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
      .time { padding: 8px 8px; font-size: 14px; }
    }
    .time { padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; cursor: pointer; text-align: center; font-weight: 600; color: var(--indigo-900); transition: all .15s ease; }
    .time:hover { border-color: var(--indigo-300); box-shadow: 0 8px 18px rgba(99, 102, 241, 0.12); transform: translateY(-1px); }
    .time.selected { border-color: var(--indigo-500); background: linear-gradient(180deg, #fff, var(--indigo-50)); box-shadow: 0 8px 18px rgba(99, 102, 241, 0.15); }
    .time:disabled { color: #94a3b8; cursor: not-allowed; background: #f8fafc; }

    .nav {
      display: flex; justify-content: space-between; gap: 10px; margin-top: 16px;
    }
    @media (max-width: 700px) {
      .nav {
        flex-direction: column-reverse;
        gap: 6px;
        margin-top: 10px;
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px) 8px;
        background: rgba(255, 255, 255, 0.9);
        -webkit-backdrop-filter: saturate(180%) blur(8px);
        backdrop-filter: saturate(180%) blur(8px);
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -6px 14px rgba(2, 6, 23, 0.06);
      }
      .nav > div {
        width: 100%;
        display: flex;
        gap: 6px;
      }
      .btn, .btn.primary {
        width: 100%;
        justify-content: center;
        font-size: 16px; /* avoid iOS zoom */
        padding: 12px 0;
      }
    }

    .btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid #e5e7eb; cursor: pointer; background: #fff; font-weight: 700; color: var(--indigo-800); }
    .btn.primary { background: linear-gradient(180deg, var(--indigo-600), var(--indigo-500)); color: #fff; border: none; box-shadow: 0 10px 20px rgba(79, 70, 229, 0.35); }
    .btn.primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

    .aside { padding: 16px; }
    .summary { display: grid; gap: 10px; }
    @media (max-width: 700px) {
      .summary {
        gap: 6px;
      }
      .summary .row {
        grid-template-columns: 90px 1fr;
        padding: 8px 8px;
        font-size: 13px;
      }
    }
    .summary .row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; font-size: 14px; }
    .summary .key { color: var(--muted); }
    .summary .val { color: var(--indigo-900); font-weight: 600; text-align: center; }
    .summary .row {
      border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px 12px; background: #fff;
    }
    .summary .row.clickable { cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease; }
    .summary .row.clickable:hover { border-color: var(--indigo-300); box-shadow: 0 8px 18px rgba(99, 102, 241, 0.12); transform: translateY(-1px); }
    .summary .row:focus-visible { outline: 3px solid var(--indigo-300); }
    .summary .val.placeholder { color: var(--muted); font-weight: 500; }

    .success {
      display: none; padding: 24px; text-align: center; color: var(--indigo-900);
    }
    .success.show { display: block; }

    .pill { display: inline-block; padding: 6px 10px; border-radius: 999px; background: var(--indigo-100); color: var(--indigo-800); font-weight: 700; font-size: 12px; }

    .footer-note { color: var(--muted); font-size: 12px; margin-top: 10px; }
    /* Calendar */
    .calendar { border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; background: #fff; }
    .cal-header { display:flex; align-items:center; justify-content:space-between; padding: 10px 12px; background: linear-gradient(180deg, var(--indigo-50), #fff); border-bottom:1px solid #e5e7eb; }
    .cal-title { font-weight: 800; color: var(--indigo-900); }
    .cal-nav { display:flex; gap:8px; }
    .cal-btn { border:1px solid #e5e7eb; background:#fff; color: var(--indigo-800); border-radius:10px; padding:6px 10px; cursor:pointer; }
    .cal-body { padding: 8px; }
    .cal-weekdays, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
    .cal-weekdays div { text-align:center; font-size:12px; color: var(--muted); font-weight: 700; padding: 6px 0; }
    .day { position: relative; min-height: 44px; border:1px solid #e5e7eb; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; background:#fff; font-weight:700; color: var(--indigo-900); }
    .day.disabled { color:#94a3b8; background:#f8fafc; cursor:not-allowed; }
    .day.available { border-color: #86efac; background: #ecfdf5; color:#065f46; }
    .day.booked { border-color: #fca5a5; background: #fef2f2; color:#7f1d1d; cursor:not-allowed;}
    .day.selected {border-color: #a5b4fc; background: #eef2ff; color: #3730a3; outline: 2px solid #a5b4fc; }
    .cal-legend { display:flex; gap:10px; align-items:center; font-size:12px; color: var(--muted); margin-top:8px; flex-wrap: wrap; }
    .legend-item { display:flex; align-items:center; gap:6px; }
    .swatch { width:14px; height:14px; border-radius:4px; border:1px solid #e5e7eb; }
    .swatch.available { background:#86efac; border-color:#86efac; }
    .swatch.booked { background:#fca5a5; border-color:#fca5a5; }
    /* Desktop enhancements for better space usage */
    @media (min-width: 1024px) {
      h1 { font-size: 28px; }
      .subtitle { font-size: 15px; }
      .content { padding: 22px; }
      .stepper { padding: 16px; }
      .step { padding: 12px 14px; }
      .step .label { font-size: 14px; }
      .step .hint { font-size: 12px; }
      .services { gap: 16px; }
      .service { padding: 18px; }
      .service .desc { font-size: 14px; }
      .service .meta { font-size: 13px; }
      .time-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
      .time { padding: 12px 14px; font-size: 15px; }
      .summary .row { grid-template-columns: 140px 1fr; }
    }

    /* Footer */
    .site-footer {
      margin-top: 24px;
      padding: 20px 16px;
      text-align: center;
      color: var(--indigo-900);
      background: linear-gradient(180deg, #fff, var(--indigo-100));
      border-top: 1px solid #e5e7eb;
    }
    .site-footer small { color: var(--muted); }

/* Mobile enhancements */
@media (max-width: 700px) {
  .day { min-height: 48px; }
  .service:active, .time:active, .summary .row.clickable:active { transform: translateY(0); box-shadow: 0 0 0 rgba(0,0,0,0); }
  .cal-btn { padding: 8px 12px; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}


/* Desktop: allow multi-line labels and descriptions (remove ellipsis) */
@media (min-width: 701px) {
  .step .label, .step .hint {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* Phone input group */
.phone-input { display: flex; gap: 8px; align-items: stretch; }
.phone-input select { flex: 0 0 120px; appearance: none }
.phone-input input { flex: 1 1 auto; }
@media (max-width: 700px) {
  .phone-input { gap: 6px; }
  .phone-input select { flex: 0 0 100px; }
}