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

:root {
  --primary: #FB9450;
  --primary-dark: #E87830;
  --primary-light: #FFF0E6;
  --success: #10b981;
  --danger: #ef4444;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
}

.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  text-align: center;
  padding: 1.5rem 1rem 1.25rem;
}

.header h1 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.4;
}

.main {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.step.active {
  display: block;
}

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

.step-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.selected-label {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* メニュー一覧 */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.125rem;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.menu-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.menu-item-name {
  line-height: 1.4;
}

.menu-item-notes {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.menu-item-notes-discount {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.menu-item-note {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.4;
}

.menu-item:active {
  background: var(--primary-light);
  border-color: var(--primary);
}

.menu-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.menu-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
}

.menu-add-label {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

.booking-cart {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fff;
}

.booking-cart-title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
}

.cart-empty {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.cart-items {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
}

.cart-item-name {
  flex: 1;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.cart-qty-btn {
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: #fff;
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.cart-qty {
  min-width: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.cart-remove-btn {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.cart-total {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.back-btn:active {
  opacity: 0.7;
}

/* カレンダー */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.nav-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: var(--card);
  border-radius: 50%;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

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

.calendar-month {
  font-size: 1.0625rem;
  font-weight: 700;
}

.calendar-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.mark {
  font-weight: 700;
  margin-right: 0.25rem;
}

.mark.available {
  color: var(--success);
}

.mark.unavailable {
  color: var(--danger);
}

.calendar {
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.calendar-weekdays span:first-child {
  color: var(--danger);
}

.calendar-weekdays span:last-child {
  color: var(--primary);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: default;
  padding: 0.125rem;
  -webkit-tap-highlight-color: transparent;
}

.calendar-day.empty {
  visibility: hidden;
}

.calendar-day.out-of-range {
  color: #cbd5e1;
}

.calendar-day .day-num {
  font-weight: 600;
  line-height: 1.2;
}

.calendar-day .day-mark {
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.125rem;
}

.calendar-day.available {
  cursor: pointer;
  background: #ecfdf5;
}

.calendar-day.available .day-mark {
  color: var(--success);
}

.calendar-day.available:active {
  background: #d1fae5;
}

.calendar-day.unavailable .day-mark {
  color: var(--danger);
}

.calendar-day.selected {
  background: var(--primary);
  color: white;
}

.calendar-day.selected .day-mark {
  color: white;
}

.calendar-day.sunday .day-num {
  color: var(--danger);
}

.calendar-day.saturday .day-num {
  color: var(--primary);
}

.calendar-day.selected .day-num {
  color: white;
}

/* 時間帯 */
.time-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.time-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  min-height: 3.5rem;
}

.time-slot.available {
  cursor: pointer;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.time-slot.available:active {
  background: #d1fae5;
}

.time-slot.available .slot-mark {
  color: var(--success);
}

.time-slot.unavailable {
  opacity: 0.55;
}

.time-slot.unavailable .slot-mark {
  color: var(--danger);
}

.time-slot.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.time-slot.selected .slot-mark {
  color: white;
}

.slot-time {
  line-height: 1.2;
}

.slot-mark {
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.125rem;
}

/* フォーム */
.booking-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.booking-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
}

.field-notice {
  font-size: 0.75rem;
  color: var(--danger);
  line-height: 1.5;
  margin: 0;
}

.required {
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--card);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 4rem;
}

.form-error {
  color: var(--danger);
  font-size: 0.875rem;
  text-align: center;
}

.confirm-lead {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.confirm-details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0;
  margin-bottom: 1rem;
}

.confirm-row {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.confirm-row:last-child {
  border-bottom: none;
}

.confirm-row dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.confirm-row dd {
  font-size: 0.9375rem;
  line-height: 1.6;
  word-break: break-word;
}

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.submit-btn:active {
  background: var(--primary-dark);
}

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

.submit-btn.secondary {
  background: var(--card);
  color: var(--primary);
  border: 2px solid var(--primary);
}

/* 完了画面 */
.complete-card {
  text-align: center;
  padding: 2rem 1rem;
}

.complete-icon {
  width: 4rem;
  height: 4rem;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
}

.complete-card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.complete-message {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.install-banner {
  margin: 0 auto 1rem;
  max-width: 420px;
  padding: 1rem;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  text-align: left;
}

.install-banner-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.375rem;
}

.install-banner-text,
.install-banner-ios,
.install-banner-android {
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-bottom: 0.375rem;
}

.install-banner-close {
  margin-top: 0.5rem;
  padding: 0.4375rem 0.875rem;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: white;
  color: var(--primary-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.footer-brand {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

.footer-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ローディング */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (min-width: 480px) {
  .time-slots {
    grid-template-columns: repeat(4, 1fr);
  }
}
