/* Smart Reserve フロント共通スタイル（BEM）
 *
 * 既存テーマからの干渉を避けるため、すべて .smres-calendar 配下にスコープし
 * 必要箇所のみ !important でテーマの table/heading スタイルを無効化する。
 */

/* フロント配色の CSS 変数。配色を変える場合はここを編集する。 */
:root {
  --smres-color-sun: #fff0f0;       /* 日曜 */
  --smres-color-sat: #f0fff0;       /* 土曜 */
  --smres-color-weekday: #fffaf2;   /* 平日 */
  --smres-color-today: #fff8dc;     /* 本日 */
  --smres-color-available: #2f855a; /* ◎ 空きあり */
  --smres-color-partial: #c05621;   /* △ 残り少 */
  --smres-color-booked: #a0aec0;    /* × 満枠 */
  --smres-color-accent: #8a2be2;    /* アクセント（ブランド紫） */
  --smres-color-text: #1a2332;
  --smres-color-text-mute: #718096;
  --smres-color-line: #e2e8f0;
  --smres-color-bg: #ffffff;
  --smres-color-bg-soft: #f7f9fc;

  /* テーブル外（年月タイトル・凡例など）の文字色。ページ背景が黒のため白。
     テーマ背景を明るくする場合はここを濃色に戻す。 */
  --smres-color-canvas-text: #ffffff;
}

/* -------------------------------------------------------------------------
 * ベース＆テーマ打ち消し（リセット）
 * ---------------------------------------------------------------------- */

.smres-calendar {
  color: var(--smres-color-canvas-text);
  background: transparent;
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

.smres-calendar,
.smres-calendar * {
  box-sizing: border-box;
}

/* テーブル全体 */
.smres-calendar table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  border-spacing: 0;
  background: var(--smres-color-bg);
  table-layout: fixed;
  font-size: inherit;
}

/* セル共通：テーマの白文字・色背景を打ち消す */
.smres-calendar th,
.smres-calendar td {
  border: 1px solid var(--smres-color-line) !important;
  padding: 6px 4px;
  text-align: center;
  vertical-align: middle;
  color: var(--smres-color-text);
  background: var(--smres-color-bg);
  font-weight: 400;
  line-height: 1.4;
}

/* 見出しセル（thead・行見出し）：薄いグレー背景＋濃い文字を強制 */
.smres-calendar thead th,
.smres-calendar tbody th[scope="row"] {
  background: var(--smres-color-bg-soft) !important;
  color: var(--smres-color-text) !important;
  font-weight: 700;
}

/* 見出し（タイトル）：テーマの装飾を打ち消す */
.smres-calendar h2.smres-calendar__title {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: var(--smres-color-canvas-text) !important;
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.smres-calendar h2.smres-calendar__title::before,
.smres-calendar h2.smres-calendar__title::after {
  content: none !important;
}

/* ボタン・リンクのリセット */
.smres-calendar button {
  font: inherit;
  cursor: pointer;
}

.smres-calendar a {
  text-decoration: none;
  box-shadow: none;
}

.smres-calendar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* -------------------------------------------------------------------------
 * 操作部（コントロール）
 * ---------------------------------------------------------------------- */

.smres-calendar__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.smres-calendar__nav {
  display: inline-flex;
  gap: 4px;
}

.smres-calendar__title {
  flex: 1 1 auto;
  min-width: 8em;
  padding: 0 4px;
}

.smres-calendar__views {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}

.smres-calendar__btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--smres-color-line);
  background: var(--smres-color-bg);
  color: var(--smres-color-text);
  padding: 7px 14px;
  border-radius: 6px;
  font: inherit;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.smres-calendar__btn:hover {
  background: var(--smres-color-bg-soft);
  border-color: var(--smres-color-text-mute);
}

.smres-calendar__btn.is-active {
  background: var(--smres-color-accent);
  border-color: var(--smres-color-accent);
  color: #fff;
}

.smres-calendar__body {
  position: relative;
}

.smres-calendar.is-loading .smres-calendar__body {
  opacity: 0.5;
  pointer-events: none;
}

/* マーク色 */
.smres-mark--high,
.smres-mark--mid { color: var(--smres-color-available); }
.smres-mark--low { color: var(--smres-color-partial); }
.smres-mark--few { color: var(--smres-color-booked); }
.smres-mark--none { color: var(--smres-color-text-mute); }

/* マーク（◎◯△×）を太字＋影で目立たせる */
.smres-month__mark,
.smres-week__cell {
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* -------------------------------------------------------------------------
 * 月表示
 * ---------------------------------------------------------------------- */

.smres-month thead th {
  padding: 8px 2px;
  font-size: 0.9em;
}

.smres-month .smres-month__dow--sun { color: #c53030 !important; }
.smres-month .smres-month__dow--sat { color: #2b6cb0 !important; }

.smres-month td {
  height: 84px;
  padding: 0 !important;
  vertical-align: top;
  background: var(--smres-color-weekday);
}

.smres-month td.is-sun { background: var(--smres-color-sun); }
.smres-month td.is-sat { background: var(--smres-color-sat); }
.smres-month td.is-today {
  background: var(--smres-color-today);
  box-shadow: inset 0 0 0 2px var(--smres-color-accent);
}
.smres-month td.is-outside { opacity: 0.4; }

.smres-month__cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 84px;
  padding: 6px;
  border: 0;
  background: none;
  text-align: left;
  color: var(--smres-color-text);
}

.smres-month__cell:hover {
  background: rgba(0, 0, 0, 0.035);
}

.smres-month__date {
  font-size: 0.9em;
  font-weight: 700;
}

.smres-month__mark {
  display: block;
  margin-top: auto;
  text-align: center;
  font-size: 1.7em;
  line-height: 1.1;
}

.smres-month__note {
  display: block;
  text-align: center;
  font-size: 0.7em;
  font-weight: 600;
  color: var(--smres-color-partial);
}

/* -------------------------------------------------------------------------
 * 週表示
 * ---------------------------------------------------------------------- */

/* -------------------------------------------------------------------------
 * 横スクロール対応テーブル（週・日表示で共通）
 * ---------------------------------------------------------------------- */

.smres-tablewrap {
  position: relative;
}

.smres-tablewrap__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* スクロール内のテーブルは押し込めず、はみ出させてスクロール可能にする */
.smres-tablewrap__scroll > table {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}

/* スクロール可能を示す右端フェード＋ヒント（はみ出している時だけ表示） */
.smres-tablewrap__hint {
  display: none;
}

.smres-tablewrap.is-scrollable .smres-tablewrap__hint {
  display: block;
  position: absolute;
  right: 8px;
  pointer-events: none;
  z-index: 4;
}

.smres-tablewrap.is-scrollable .smres-tablewrap__hint--top {
  top: 44px; /* JS がヘッダー高さに応じて上書きする */
  right: 8px;
  left: auto;
}

.smres-tablewrap.is-scrollable .smres-tablewrap__hint--bottom {
  bottom: 8px;
}

.smres-tablewrap.is-scrollable .smres-tablewrap__hint span {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(26, 35, 50, 0.78);
  color: #fff;
  font-size: 0.72em;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.smres-tablewrap.is-scrollable::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--smres-color-bg));
}

.smres-tablewrap.is-scrolled-end .smres-tablewrap__hint,
.smres-tablewrap.is-scrolled-end::after {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.smres-week thead th {
  padding: 8px 4px;
  font-size: 0.85em;
  line-height: 1.3;
}

.smres-week thead th small {
  color: var(--smres-color-text-mute);
  font-size: 0.85em;
}

.smres-week thead th.is-today {
  box-shadow: inset 0 -3px 0 var(--smres-color-accent);
}

.smres-week thead th:not(.smres-week__staff) {
  min-width: 64px;
}

.smres-week__staff {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left !important;
  width: 148px;
  min-width: 148px;
  white-space: normal;
  word-break: break-word;
}

/* 名前は 姓／名 それぞれ1行で（3文字程度まで折り返さない） */
.smres-staffcell__name {
  white-space: nowrap;
}

.smres-week td {
  padding: 0;
  height: 52px;
  min-width: 64px;
}

.smres-week__off {
  display: inline-block;
  color: var(--smres-color-text-mute);
  font-size: 1.2em;
}

.smres-week__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 52px;
  border: 0;
  background: none;
  font-size: 1.5em;
  line-height: 1;
}

.smres-week__cell:hover {
  background: rgba(0, 0, 0, 0.045);
}

/* -------------------------------------------------------------------------
 * 日表示
 * ---------------------------------------------------------------------- */

.smres-day__hint {
  margin: 0 0 10px;
  font-size: 0.9em;
  color: var(--smres-color-canvas-text);
}

.smres-day thead th {
  padding: 10px 8px;
}

/* 日表示：縦スクロールでヘッダーを固定する（高さ付きスクロール枠） */
.smres-tablewrap--day .smres-tablewrap__scroll {
  overflow: auto;
  max-height: 70vh;
}

.smres-day thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* 左上の「時間」セルは縦横とも固定するため最前面に */
.smres-day thead th.smres-day__time {
  z-index: 5;
}

.smres-day thead th:not(.smres-day__time) {
  min-width: 128px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

.smres-day__time {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 84px;
  min-width: 84px;
  background: var(--smres-color-bg-soft) !important;
  white-space: nowrap;
  font-weight: 700;
  padding: 8px 10px;
}

.smres-day__cell {
  min-width: 88px;
}

.smres-day__note {
  display: block;
  margin-top: 2px;
  font-size: 0.75em;
  font-weight: 400;
  color: var(--smres-color-partial);
}

.smres-day td {
  padding: 0;
}

.smres-day__cell {
  height: 40px;
}

/* 週表示から来たときの対象スタッフ列ハイライト */
.smres-day thead th.smres-day__staff.is-highlight {
  background: rgba(44, 82, 130, 0.12) !important;
  box-shadow: inset 2px 0 0 var(--smres-color-accent), inset -2px 0 0 var(--smres-color-accent), inset 0 2px 0 var(--smres-color-accent);
}

.smres-day td.smres-day__cell.is-highlight {
  background: rgba(44, 82, 130, 0.06);
}

/* 縦線をセル中身（予約可スロット含む）にも引く */
.smres-day td.smres-day__cell.is-highlight .smres-slot {
  box-shadow: inset 2px 0 0 var(--smres-color-accent), inset -2px 0 0 var(--smres-color-accent);
}

.smres-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 40px;
  border: 0;
  background: none;
  font-size: 0.9em;
  color: inherit;
}

.smres-slot--available {
  background: linear-gradient(135deg, #ff2d9b 0%, #7b2ff7 100%);
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.smres-slot--partial {
  background: linear-gradient(135deg, #ff7ac1 0%, #a97bf7 100%);
  color: #fff;
  font-weight: 700;
}

.smres-slot--booked {
  background: var(--smres-color-booked);
  color: #fff;
  cursor: not-allowed;
}

.smres-slot--off {
  cursor: default;
}

.smres-slot--available:hover,
.smres-slot--partial:hover {
  filter: brightness(1.08);
}

/* -------------------------------------------------------------------------
 * 凡例
 * ---------------------------------------------------------------------- */

.smres-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85em;
  color: var(--smres-color-canvas-text);
}

.smres-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.smres-legend__swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid var(--smres-color-line);
}

.smres-legend__swatch--available { background: #c6f6d5; }
.smres-legend__swatch--partial { background: #fefcbf; }
.smres-legend__swatch--booked { background: var(--smres-color-booked); }

.smres-calendar__empty {
  padding: 16px;
  background: var(--smres-color-bg-soft);
  border: 1px solid var(--smres-color-line);
  border-radius: 6px;
  color: var(--smres-color-text-mute);
  text-align: center;
}

/* -------------------------------------------------------------------------
 * レスポンシブ
 * ---------------------------------------------------------------------- */

/* スタッフ名（姓・名の分割表示） */
.smres-name__part {
  display: inline;
}

@media (max-width: 768px) {
  .smres-calendar {
    font-size: 14px;
  }

  /* スマホでは姓・名を二段に分けて整列させる（長い名前のみ） */
  .smres-calendar .smres-name--stack .smres-name__part {
    display: block;
  }

  .smres-calendar__controls {
    gap: 8px;
  }

  .smres-calendar__title {
    order: -1;
    flex-basis: 100%;
    text-align: center;
  }

  .smres-calendar__views {
    margin-left: 0;
  }

  .smres-month td {
    height: 62px;
  }

  .smres-month__cell {
    min-height: 62px;
    padding: 3px;
  }

  .smres-month__mark {
    font-size: 1.3em;
  }

  .smres-month__note {
    font-size: 0.62em;
  }
}

/* =========================================================================
 * 予約フォーム
 * ====================================================================== */

.smres-form {
  --smres-line: var(--smres-color-line);
  max-width: 640px;
  margin: 0 auto;
  padding: 20px;
  background: var(--smres-color-bg);
  color: var(--smres-color-text);
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.6;
}

.smres-form,
.smres-form * {
  box-sizing: border-box;
}

/* hidden 属性を CSS の display 指定より優先させる（モーダル・その他入力など）。 */
.smres-form [hidden] {
  display: none !important;
}

.smres-form input,
.smres-form select,
.smres-form textarea {
  font: inherit;
  color: var(--smres-color-text);
}

/* 進捗バー */
.smres-form__progress {
  display: flex;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: smres;
}

.smres-form__progress-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  font-size: 0.72em;
  color: var(--smres-color-text-mute);
  text-align: center;
}

.smres-form__progress-item::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--smres-color-line);
  z-index: 0;
}

.smres-form__progress-item:first-child::before {
  display: none;
}

.smres-form__progress-num {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--smres-color-bg-soft);
  border: 1px solid var(--smres-color-line);
  color: var(--smres-color-text-mute);
  font-weight: 700;
}

.smres-form__progress-item.is-active .smres-form__progress-num {
  background: var(--smres-color-accent);
  border-color: var(--smres-color-accent);
  color: #fff;
}

.smres-form__progress-item.is-done .smres-form__progress-num {
  background: linear-gradient(135deg, #ff2d9b 0%, #8a2be2 100%);
  border-color: transparent;
  color: #fff;
}

.smres-form__progress-item.is-active {
  color: var(--smres-color-text);
  font-weight: 700;
}

.smres-form__stepinfo {
  margin: 0 0 12px;
  font-size: 0.85em;
  color: var(--smres-color-text-mute);
}

.smres-form__heading {
  margin: 0 0 14px;
  font-size: 1.15em;
  font-weight: 700;
}

/* ハニーポット */
.smres-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* 選択済みの指名・日時（Step2 上部） */
.smres-form__context {
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--smres-color-bg-soft);
  border: 1px solid var(--smres-color-line);
  border-left: 4px solid var(--smres-color-accent);
  border-radius: 6px;
}

.smres-form__context.has-photo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.smres-form__context-photo {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.smres-form__context-body {
  flex: 1 1 auto;
  min-width: 0;
}

.smres-form__context-name {
  font-weight: 700;
  font-size: 1.1em;
}

.smres-form__context-datetime {
  margin-top: 4px;
  font-weight: 700;
  color: var(--smres-color-text);
}

.smres-form__context-row {
  display: flex;
  gap: 10px;
  padding: 2px 0;
}

.smres-form__context-key {
  flex: 0 0 4.5em;
  font-size: 0.85em;
  font-weight: 700;
  color: var(--smres-color-text-mute);
}

.smres-form__context-val {
  font-weight: 700;
}

/* 選択カード */
.smres-form__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.smres-form__card {
  display: block;
  cursor: pointer;
}

.smres-form__card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.smres-form__card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 12px;
  border: 2px solid var(--smres-color-line);
  border-radius: 8px;
  background: var(--smres-color-bg);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.smres-form__card:hover .smres-form__card-body {
  border-color: var(--smres-color-text-mute);
}

.smres-form__card input:checked + .smres-form__card-body {
  border-color: #d63638;
  background: #fff5f5;
  box-shadow: 0 0 0 1px #d63638 inset;
}

.smres-form__card input:checked + .smres-form__card-body .smres-form__card-name {
  color: #b32d2e;
}

.smres-form__card input:checked + .smres-form__card-body::before {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  background: #d63638;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.smres-form__card-body {
  position: relative;
}

.smres-form__card input:focus-visible + .smres-form__card-body {
  outline: 2px solid var(--smres-color-accent);
  outline-offset: 2px;
}

.smres-form__card-thumb img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.smres-form__card-name {
  font-weight: 700;
}

.smres-form__card-note {
  font-size: 0.8em;
  color: var(--smres-color-text-mute);
}

.smres-form__card-price {
  font-size: 0.9em;
  color: var(--smres-color-partial);
  font-weight: 600;
}

/* フィールド */
.smres-form__field {
  margin-bottom: 18px;
}

.smres-form__label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.95em;
}

.smres-form__req {
  color: #d63638;
  margin-left: 2px;
}

.smres-form__input,
.smres-form__select,
.smres-form__textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--smres-color-line);
  border-radius: 6px;
  background: var(--smres-color-bg);
}

.smres-form__input:focus,
.smres-form__select:focus,
.smres-form__textarea:focus {
  outline: none;
  border-color: var(--smres-color-accent);
  box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.15);
}

.smres-form__custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.smres-form__custom .smres-form__input {
  width: 120px;
}

.smres-form__hint {
  display: block;
  margin-top: 4px;
  font-size: 0.8em;
  color: var(--smres-color-text-mute);
}

.smres-form__error {
  display: block;
  margin-top: 6px;
  color: #d63638;
  font-size: 0.85em;
  min-height: 1em;
}

/* ラジオ（ご利用） */
.smres-form__radios {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.smres-form__radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* 生年月日 */
.smres-form__birth {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.smres-form__birth .smres-form__select {
  width: auto;
  min-width: 80px;
}

/* チェックボックス群 */
.smres-form__checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.smres-form__check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* お客様情報の保存チェック（step-4 下部） */
.smres-form__save {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--smres-color-line);
  border-radius: 8px;
}

.smres-form__save .smres-form__check {
  font-weight: 700;
}

.smres-form__save .smres-form__hint {
  margin-top: 6px;
}

/* 日時 */
.smres-form__datebar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.smres-form__date {
  flex: 1 1 auto;
}

.smres-form__slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  min-height: 40px;
}

.smres-form__slots-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px;
  text-align: center;
  color: var(--smres-color-text-mute);
  background: var(--smres-color-bg-soft);
  border-radius: 6px;
}

.smres-form__slot {
  padding: 10px 6px;
  border: 1px solid var(--smres-color-line);
  border-radius: 6px;
  background: var(--smres-color-bg);
  cursor: pointer;
  text-align: center;
  font-weight: 600;
}

.smres-form__slot--available { border-color: #9ae6b4; }
.smres-form__slot--partial { border-color: #f6e05e; background: #fffff0; }

.smres-form__slot:hover {
  border-color: var(--smres-color-accent);
}

.smres-form__slot.is-selected {
  background: var(--smres-color-accent);
  border-color: var(--smres-color-accent);
  color: #fff;
}

.smres-form__selected {
  margin: 12px 0 0;
  font-weight: 700;
  font-size: 1.05em;
  color: var(--smres-color-accent);
  white-space: pre-line;
  min-height: 1.4em;
}

.smres-form__selected.is-hint {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--smres-color-text-mute);
}

/* ナビゲーション */
.smres-form__nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}

.smres-form__btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--smres-color-line);
  background: var(--smres-color-bg);
  color: var(--smres-color-text);
  padding: 10px 20px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.smres-form__btn:hover {
  background: var(--smres-color-bg-soft);
}

.smres-form__btn--primary {
  background: var(--smres-color-accent);
  border-color: var(--smres-color-accent);
  color: #fff;
}

.smres-form__btn--primary:hover {
  filter: brightness(1.08);
  background: var(--smres-color-accent);
}

.smres-form__btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* 確認サマリー */
.smres-form__summary {
  margin: 0 0 8px;
  border: 1px solid var(--smres-color-line);
  border-radius: 8px;
  overflow: hidden;
}

.smres-form__summary dt {
  padding: 8px 12px;
  background: var(--smres-color-bg-soft);
  font-weight: 700;
  font-size: 0.85em;
  border-top: 1px solid var(--smres-color-line);
}

.smres-form__summary dt:first-child {
  border-top: 0;
}

.smres-form__summary dd {
  margin: 0;
  padding: 8px 12px 12px;
  white-space: pre-wrap;
}

/* モーダル */
.smres-form__modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.smres-form__modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.smres-form__modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  padding: 24px;
  background: var(--smres-color-bg);
  color: var(--smres-color-text);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.smres-form__modal-title {
  margin: 0 0 18px;
  font-weight: 700;
  font-size: 1.05em;
}

.smres-form__modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* 完了 */
.smres-form__complete {
  text-align: center;
  padding: 24px 12px;
}

.smres-form__complete-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--smres-color-available);
  color: #fff;
  font-size: 28px;
}

.smres-form__complete-id {
  margin-top: 10px;
  font-weight: 700;
  color: var(--smres-color-text-mute);
}

/* レスポンシブ */
@media (max-width: 768px) {
  .smres-form {
    padding: 14px;
  }

  .smres-form__progress-label {
    display: none;
  }

  .smres-form__cards {
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================================================================
 * アクセシビリティ：キーボードフォーカスの可視化
 * ====================================================================== */

.smres-calendar__btn:focus-visible,
.smres-month__cell:focus-visible,
.smres-week__cell:focus-visible,
.smres-slot:focus-visible,
.smres-form__btn:focus-visible,
.smres-form__slot:focus-visible,
.smres-form__select:focus-visible,
.smres-form__input:focus-visible,
.smres-form__textarea:focus-visible {
  outline: 3px solid var(--smres-color-accent);
  outline-offset: 2px;
}

.smres-form__heading:focus {
  outline: none;
}

/* 進捗の現在地（aria-current）を視覚的にも強調 */
.smres-form__progress-item[aria-current="step"] .smres-form__progress-num {
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.25);
}

/* =========================================================================
 * ナースのアバター（円形写真）＋ 詳細カード（画面中央ツールチップ）
 * ====================================================================== */

/* スタッフセル：左に写真・右に名前 */
.smres-staffcell {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.smres-staffcell--col {
  justify-content: flex-start;
}

.smres-staffcell__name {
  flex: 1 1 auto;
  min-width: 0;
}

/* セルを少し高く */
.smres-week__staff,
.smres-day__staff {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

/* アバター（円形・パルスで「押して」を演出） */
.smres-avatar {
  position: relative;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  display: inline-flex;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
}

.smres-avatar__img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
  position: relative;
  z-index: 1;
}

.smres-avatar:hover .smres-avatar__img,
.smres-avatar:focus-visible .smres-avatar__img {
  transform: scale(1.08);
}

.smres-avatar:focus-visible .smres-avatar__img {
  border-color: var(--smres-color-accent);
}

/* 「わたしをクリックして」風のパルスリング */
.smres-avatar__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.55);
  animation: smres-avatar-pulse 2s ease-out infinite;
}

@keyframes smres-avatar-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(197, 48, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .smres-avatar__pulse { animation: none; }
}

/* 詳細カード（画面中央・ふわっと表示） */
.smres-nursecard {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.smres-nursecard.is-visible {
  opacity: 1;
}

.smres-nursecard__inner {
  width: min(300px, 86vw);
  padding: 22px;
  background: #fff;
  color: #1a2332;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38);
  text-align: center;
  transform: translateY(10px) scale(0.97);
  transition: transform 0.18s ease;
}

.smres-nursecard.is-visible .smres-nursecard__inner {
  transform: translateY(0) scale(1);
}

.smres-nursecard__img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.smres-nursecard__name {
  margin-top: 12px;
  font-weight: 700;
  font-size: 1.15em;
}

.smres-nursecard__profile {
  margin-top: 8px;
  font-size: 0.92em;
  line-height: 1.6;
  color: #4a5568;
  white-space: pre-wrap;
}

/* カードは表示中のみ操作可能に（中央のリンクを押せるように／非表示時は背後を邪魔しない） */
.smres-nursecard.is-visible .smres-nursecard__inner {
  pointer-events: auto;
}

/* プロフィールリンクボタン */
.smres-nursecard__link {
  display: inline-block;
  margin-top: 16px;
  padding: 9px 18px;
  background: var(--smres-color-accent);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 700;
}

.smres-nursecard__link:hover {
  filter: brightness(1.1);
}

.smres-nursecard__link[hidden] {
  display: none;
}

/* ナースカード：✕ 閉じるボタン */
.smres-nursecard__inner {
  position: relative;
}

.smres-nursecard__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: #4a5568;
  cursor: pointer;
}

.smres-nursecard__close:hover {
  background: rgba(0, 0, 0, 0.12);
}

/* 別ナースへ切り替えたときのふわっと再フェード */
.smres-nursecard__inner.is-fade {
  animation: smres-cardfade 0.2s ease;
}

@keyframes smres-cardfade {
  from { opacity: 0.35; transform: translateY(4px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .smres-nursecard__inner.is-fade { animation: none; }
}

/* 確認画面：ページ上部の「まだ予約は完了していません」注意 */
.smres-form__notice {
  margin: 0 0 14px;
  padding: 10px 14px;
  text-align: center;
  font-weight: 700;
  color: #b32d2e;
  background: #fff5f5;
  border: 1px solid #f5c2c2;
  border-radius: 8px;
}

/* 確認画面：予約失敗アラート（大きく目立たせる） */
.smres-form__alert {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: #fff5f5;
  border: 2px solid #e53e3e;
  border-radius: 8px;
  color: #9b2c2c;
}

.smres-form__alert[hidden] {
  display: none;
}

.smres-form__alert-title {
  margin: 0;
  font-weight: 800;
  font-size: 1.05em;
}

.smres-form__alert-list {
  margin: 8px 0 0;
  padding-left: 1.2em;
  list-style: disc;
}

.smres-form__alert-list li {
  margin: 2px 0;
}

/* 日カレンダー：おまかせ列を少し区別 */
.smres-day thead th.smres-day__staff.is-omakase {
  background: #f6edff !important;
}

.smres-day td.smres-day__cell.is-omakase {
  background: #faf6ff;
}

/* =========================================================================
 * ホットペッパー型カレンダー：スタッフ選択 ＋ 空き状況グリッド
 * ====================================================================== */

/* --- スタッフ選択 --- */

/* 案内文：左右にラインを添えたディバイダー風（ページ見出しと区別する） */
.smres-staffsel__lead {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.98em;
  font-weight: 600;
}

.smres-staffsel__lead::before,
.smres-staffsel__lead::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(138, 43, 226, 0.1), rgba(138, 43, 226, 0.6));
}

.smres-staffsel__lead::after {
  background: linear-gradient(90deg, rgba(138, 43, 226, 0.6), rgba(138, 43, 226, 0.1));
}

.smres-staffsel__lead span {
  flex: 0 0 auto;
}

.smres-staffsel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.smres-staffsel__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  background: #fff;
  border: 1px solid var(--smres-color-line);
  border-radius: 10px;
  color: var(--smres-color-text);
  text-align: center;
}

.smres-staffsel__photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.smres-staffsel__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.smres-staffsel__name {
  font-weight: 700;
  font-size: 1.02em;
}

.smres-staffsel__reading {
  font-size: 0.78em;
  color: var(--smres-color-text-mute);
}

.smres-staffsel__detail {
  font-size: 0.8em;
  color: #8a2be2;
  text-decoration: underline;
}

/* プロフィールリンクが無いカード用の余白（高さ合わせのダミー） */
.smres-staffsel__detail--blank {
  visibility: hidden;
  text-decoration: none;
}

.smres-staffsel__btn {
  margin-top: 6px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: #8a2be2;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.smres-staffsel__btn:hover {
  filter: brightness(1.08);
}

/* ひとことコメント（「空き状況を見る」ボタンの下）。
   全カード同じ幅・同じ高さ（3行分固定）のエリアにし、文字数による崩れを防ぐ */
.smres-staffsel__comment {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: calc(4.5em + 8px); /* 3行（line-height 1.5 × 3）＋上下パディング */
  margin-top: 2px;
  padding: 4px 6px;
  box-sizing: border-box;
  border-radius: 8px;
  background: #f3ebff;
  color: #5b21a8;
  font-size: 0.78em;
  line-height: 1.5;
  overflow: hidden;
}

/* 長すぎる場合は3行で自動カット */
.smres-staffsel__comment span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
}

/* --- グリッド --- */
.smres-grid__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.smres-grid__back {
  border: 1px solid var(--smres-color-line);
  background: #fff;
  color: var(--smres-color-text);
  padding: 6px 12px;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}

.smres-grid__staff {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--smres-color-canvas-text);
}

.smres-grid__staff-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.smres-grid__staff-name {
  font-weight: 700;
}

.smres-grid__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.smres-grid__title {
  font-weight: 700;
  color: var(--smres-color-canvas-text);
}

/* グリッドテーブル：縦スクロールでヘッダー固定 */
.smres-tablewrap--grid .smres-tablewrap__scroll {
  overflow: auto;
  max-height: 72vh;
}

.smres-grid__table {
  border-collapse: collapse;
  background: #fff;
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.smres-grid__table th,
.smres-grid__table td {
  border: 1px solid var(--smres-color-line) !important;
  text-align: center;
  padding: 0;
  color: var(--smres-color-text);
}

.smres-grid__timecol {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 62px;
  min-width: 62px;
  background: var(--smres-color-bg-soft) !important;
  font-weight: 700;
  font-size: 0.8em;
  padding: 4px 6px !important;
  white-space: nowrap;
}

.smres-grid__table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--smres-color-bg-soft) !important;
  padding: 5px 2px !important;
  font-size: 0.78em;
  line-height: 1.25;
}

.smres-grid__table thead th.smres-grid__timecol {
  z-index: 5;
}

.smres-grid__datecol { min-width: 44px; }
.smres-grid__d-day { display: block; font-weight: 700; font-size: 1.1em; }
.smres-grid__d-dow { display: block; font-size: 0.85em; color: var(--smres-color-text-mute); }
.smres-grid__datecol.is-sun .smres-grid__d-day,
.smres-grid__datecol.is-sun .smres-grid__d-dow { color: #c53030; }
.smres-grid__datecol.is-sat .smres-grid__d-day,
.smres-grid__datecol.is-sat .smres-grid__d-dow { color: #2b6cb0; }
.smres-grid__datecol.is-today { box-shadow: inset 0 -3px 0 #8a2be2; }

.smres-grid__cell { height: 34px; }

.smres-grid__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 34px;
  font-size: 1em;
  font-weight: 700;
  text-decoration: none;
}

.smres-grid__mark--ok {
  color: #8a2be2;
  cursor: pointer;
}

.smres-grid__mark--ok:hover {
  background: #f3ebff;
}

.smres-grid__mark--ng {
  color: #cbd5e0;
  cursor: default;
}

/* 要予約（△）。予約フォームへのリンク */
.smres-grid__mark--req {
  color: #ff2d9b;
  cursor: pointer;
}

.smres-grid__mark--req:hover {
  background: #ffeaf5;
}

/* 受付満了（ー） */
.smres-grid__mark--none {
  color: #98a2b3;
  cursor: default;
}

/* マークの見方（グリッド上部の凡例） */
.smres-grid__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  color: #fff;
  font-size: 0.88em;
}

.smres-grid__legend li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.smres-grid__legend li::before {
  content: none;
}

.smres-grid__legend-mark {
  font-weight: 700;
}

.smres-grid__legend-mark--none { color: #98a2b3; }
.smres-grid__legend-mark--ok { color: #b07ef7; }
.smres-grid__legend-mark--req { color: #ff2d9b; }
.smres-grid__legend-mark--ng { color: #cbd5e0; }

/* 管理画面（設定 → カレンダー上部の説明文）から入力するフロント説明文。既定は白文字 */
.smres-calendar .smres-front-note,
.smres-front-note {
  color: #fff;
  line-height: 1.75;
  margin: 0 0 16px;
}

.smres-calendar .smres-front-note p,
.smres-front-note p {
  color: inherit;
  margin: 0 0 8px;
}

.smres-front-note p:last-child {
  margin-bottom: 0;
}

/* スマホは1週間（先頭7日）だけ表示 */
@media ( max-width: 768px ) {
  .smres-grid__col2 { display: none; }
}

/* =========================================================================
 * フォームのダークスキン（サイトの黒背景に馴染ませる）
 * 白いカードをやめ、背景は透過・文字は白。入力欄やカードは白のまま。
 * ====================================================================== */

.smres-form {
  background: rgba(255, 255, 255, 0.04);
  color: var(--smres-color-canvas-text);
  padding: 26px 24px;
  border: 1px solid rgba(138, 43, 226, 0.45);
  border-radius: 14px;
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.55),
    0 0 22px rgba(138, 43, 226, 0.18);
}

@media ( max-width: 768px ) {
  .smres-form {
    padding: 18px 14px;
  }
}

.smres-form__heading {
  color: inherit;
}

.smres-form__stepinfo,
.smres-form__hint {
  color: rgba(255, 255, 255, 0.66);
}

.smres-form__progress-item {
  color: rgba(255, 255, 255, 0.6);
}

.smres-form__progress-item.is-active {
  color: #fff;
}

.smres-form__error,
.smres-form__req {
  color: #ff8a8a;
}

/* 白背景の中身は文字を濃色に戻す */
.smres-form__card-body,
.smres-form__context,
.smres-form__summary,
.smres-form__slot {
  color: var(--smres-color-text);
}

.smres-form__summary {
  background: #fff;
}

/* 第二希望（日付＋時間の横並び） */
.smres-form__second {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.smres-form__second-date {
  width: auto;
  min-width: 170px;
}

.smres-form__second-time {
  width: auto;
  min-width: 100px;
}
