:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e8efff;
  --bg: #f4f5f8;
  --card: #ffffff;
  --text: #111318;
  --text-2: #5b6170;
  --text-3: #9aa0ad;
  --border: #e4e6ec;
  --success: #16a34a;
  --success-soft: #e3f5e9;
  --warning: #d97706;
  --warning-soft: #fdf1de;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #4f86ff;
    --primary-dark: #3b74f5;
    --primary-soft: #1a2747;
    --bg: #0b0c10;
    --card: #17191f;
    --text: #f3f4f7;
    --text-2: #a7adba;
    --text-3: #6b7280;
    --border: #262a33;
    --success: #34d36b;
    --success-soft: #12301c;
    --warning: #f5a524;
    --warning-soft: #33260f;
    --danger: #f26363;
    --danger-soft: #3a1717;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: #fff;
  border-radius: 22px;
  padding: 22px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.hero .avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}

.hero h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero p {
  opacity: 0.9;
  font-size: 15px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  margin: 4px 4px -6px;
}

.muted {
  color: var(--text-2);
  font-size: 14px;
}

.small {
  font-size: 13px;
  color: var(--text-3);
}

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

.chip {
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: var(--shadow);
}

.chip.active {
  background: var(--primary);
  color: #fff;
}

.days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.days::-webkit-scrollbar {
  display: none;
}

.day {
  flex: 0 0 auto;
  width: 62px;
  padding: 10px 0;
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  scroll-snap-align: start;
}

.day .dow {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
}

.day .num {
  font-size: 20px;
  font-weight: 800;
}

.day .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.day.full .dot {
  background: var(--border);
}

.day.full .num {
  color: var(--text-3);
}

.day.active {
  background: var(--primary);
  color: #fff;
}

.day.active .dow {
  color: rgba(255, 255, 255, 0.85);
}

.day.active .num {
  color: #fff;
}

.day.active .dot {
  background: #fff;
}

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

.time {
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 12px;
  padding: 12px 0;
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.time.active {
  background: var(--primary);
  color: #fff;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border-radius: 14px;
  padding: 15px 16px;
  font-weight: 700;
  font-size: 17px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.99);
}

.btn[disabled] {
  opacity: 0.6;
}

.btn.secondary {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn.ghost {
  background: transparent;
  color: var(--primary);
  padding: 10px;
  font-size: 15px;
}

.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.row-actions .btn {
  width: auto;
  flex: 1 1 auto;
  padding: 10px 14px;
  font-size: 15px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

input,
textarea {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

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

.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.booking {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.booking .when {
  font-size: 17px;
  font-weight: 700;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 700;
  align-self: flex-start;
}

.pill.ok {
  background: var(--success-soft);
  color: var(--success);
}

.pill.wait {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill.off {
  background: var(--danger-soft);
  color: var(--danger);
}

.message {
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-2);
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.notice .icon {
  font-size: 22px;
  line-height: 1;
}

.pass {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pass .big {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.bar {
  height: 8px;
  border-radius: 4px;
  background: var(--primary-soft);
  overflow: hidden;
  margin-top: 8px;
}

.bar > div {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
}

.center {
  text-align: center;
}

.success-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 8px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  max-width: calc(100% - 32px);
  z-index: 10;
}

.demo-banner {
  background: var(--warning-soft);
  color: var(--warning);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
}

footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  margin-top: 8px;
}

.skeleton {
  height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--card) 0%, var(--border) 50%, var(--card) 100%);
  background-size: 200% 100%;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.legal h2 {
  font-size: 18px;
  margin: 8px 0 4px;
}

.legal p,
.legal li {
  font-size: 15px;
  color: var(--text-2);
}

.legal ul {
  padding-left: 20px;
  margin: 4px 0;
}

.legal p + p,
.legal ul + p,
.legal p + ul {
  margin-top: 8px;
}

.proposal {
  margin-top: 8px;
  background: var(--warning-soft);
  border-radius: 12px;
  padding: 12px;
}

.proposal .row-actions {
  margin-top: 10px;
}

.email-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 12px;
  font-size: 14px;
  color: var(--text-2);
}

.link-btn {
  background: none;
  border: 0;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}

.email-form {
  gap: 4px;
}

.email-form .inline {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.email-form .inline input {
  flex: 1;
  min-width: 0;
}

.email-form .inline .btn {
  width: auto;
  flex: none;
}
