:root {
  --ivory: oklch(0.985 0.008 85);
  --ivory-deep: oklch(0.96 0.012 80);
  --rose: oklch(0.68 0.12 18);
  --rose-deep: oklch(0.55 0.14 22);
  --text: oklch(0.25 0.01 50);
  --text-mute: oklch(0.45 0.01 50);
  --line: oklch(0.88 0.008 60);
  --error: oklch(0.55 0.18 25);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: "Noto Serif JP", serif;
  background: var(--ivory);
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}
button, input, select { font-family: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  text-align: center;
}
.brand {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  color: var(--rose);
  font-size: 16px;
  letter-spacing: 0.08em;
}
.hospital-name {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 2px;
}

.progress {
  position: sticky;
  top: 53px;
  background: var(--ivory);
  height: 3px;
  z-index: 9;
}
.progress::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--rose);
  width: var(--pct, 0%);
  transition: width 0.3s;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 18px 60px;
}

.step {
  padding: 16px 0;
}
.hidden { display: none !important; }

h1 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin: 8px 0 16px;
}
.lead {
  font-size: 14px;
  color: var(--text-mute);
  margin-bottom: 16px;
  line-height: 1.85;
}
.note {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 14px;
  line-height: 1.7;
}

.req {
  color: var(--rose);
  font-size: 11px;
  margin-left: 6px;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, opacity 0.15s;
}
.btn.primary {
  background: var(--rose);
  color: #fff;
  font-weight: 500;
  width: 100%;
  margin: 14px 0 8px;
  padding: 14px;
}
.btn.primary:disabled { background: var(--line); cursor: not-allowed; }
.btn.primary:hover:not(:disabled) { background: var(--rose-deep); }
.btn.link {
  background: none;
  color: var(--text-mute);
  text-decoration: underline;
  padding: 8px 14px;
  font-size: 13px;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}
.step-actions .btn.primary { width: auto; margin: 0; }

/* カレンダー */
.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 0;
}
.cal-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-mute);
}
#cal-title { font-size: 16px; font-weight: 500; }
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  cursor: default;
}
.cal-cell.head {
  background: transparent;
  color: var(--text-mute);
  font-size: 11px;
  aspect-ratio: auto;
  padding: 4px 0;
}
.cal-cell.muted { color: var(--line); background: var(--ivory-deep); }
.cal-cell.available { background: oklch(0.96 0.04 25); color: var(--rose); cursor: pointer; font-weight: 600; }
.cal-cell.available:hover { background: oklch(0.92 0.08 20); }
.cal-cell.selected { background: var(--rose); color: #fff; }

/* スロット */
.slot-list { display: grid; gap: 8px; }
.slot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.slot-item:hover:not(.full) { border-color: var(--rose); }
.slot-item.full { color: var(--text-mute); cursor: not-allowed; background: var(--ivory-deep); }
.slot-item .slot-avail { font-size: 12px; color: var(--text-mute); }
.slot-item.full .slot-avail { color: var(--text-mute); }

/* プラン */
.plan-list { display: grid; gap: 12px; }
.plan-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.plan-card:hover { border-color: var(--rose); }
.plan-card.selected { border-color: var(--rose); background: oklch(0.985 0.012 25); }
.plan-card h3 {
  font-size: 16px;
  margin: 0 0 4px;
  font-weight: 600;
}
.plan-card .price {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  color: var(--rose);
}
.plan-card .desc { font-size: 13px; color: var(--text-mute); margin-top: 6px; }
.plan-card .perk { font-size: 12px; color: var(--text-mute); margin-top: 4px; }

#option-area {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.opt-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.opt-item input[type=checkbox] { accent-color: var(--rose); width: 18px; height: 18px; }

/* フォーム */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.form-row input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.form-row input:focus { outline: none; border-color: var(--rose); }

/* 同意 */
.consent-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.consent-item.checked { border-color: var(--rose); background: oklch(0.985 0.012 25); }
.consent-item input { margin-top: 4px; flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--rose); }
.consent-item .text strong {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.consent-item .text span {
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.7;
}

/* 署名 */
.sign-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
#sig-canvas { width: 100%; height: 100%; touch-action: none; cursor: crosshair; display: block; }
.sign-placeholder {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-mute);
  font-size: 13px;
  pointer-events: none;
}
.sign-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

/* 確認 */
.summary {
  background: var(--ivory-deep);
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 13px;
}
.summary dl { margin: 0; }
.summary dt { color: var(--text-mute); font-size: 11px; margin-top: 8px; }
.summary dd { margin: 0; font-size: 14px; }
.summary dt:first-child { margin-top: 0; }

.error-msg {
  margin-top: 14px;
  padding: 12px;
  background: oklch(0.97 0.02 25);
  border-left: 3px solid var(--error);
  color: var(--error);
  font-size: 13px;
  border-radius: 4px;
}

.done-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--rose);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 16px auto 18px;
}
#step-done { text-align: center; }
#step-done .summary { text-align: left; margin-top: 18px; }
