/* =========================================
   訪問記録モーダル (visit_modal.css)
========================================= */

/* ---- Backdrop & sheet ---- */
.visit-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.40);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.visit-modal.is-hidden { display: none; }

.visit-sheet {
  width: min(100vw, 560px);
  background: #fff;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.14);
  max-height: 92dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

/* ---- 固定ヘッダー（header + toolbar）。スクロール領域の外に置くことで
   本文（写真パネル等）がヘッダーより前面に出ないようにする ---- */
.visit-sheet__top {
  background: #fff;
  padding: 20px 16px 8px;
}

/* ---- スクロールする本文（アコーディオンパネル群・評価・メモ・フッター） ---- */
.visit-sheet__body {
  overflow-y: auto;
  min-height: 0;
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- Header ---- */
.visit-sheet__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.visit-sheet__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  flex: 1;
}

/* ---- Delete button（ゴミ箱アイコン） ---- */
.visit-delete-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #f0f0f0;
  /* 他の選択中・アクセントと同じブランドピンク */
  color: #e95b6b;
  cursor: pointer;
}
.visit-delete-btn__icon {
  display: block;
  width: 18px;
  height: 18px;
}
.visit-delete-btn:hover { background: #e6e6e6; }
/* display:flex より後・高詳細度で打ち消す */
.visit-delete-btn.is-hidden { display: none; }

/* ---- Photo button ---- */
.visit-photo-btn {
  position: relative;
  flex-shrink: 0;
  /* <button>（shared/_rating_modal）。UA 既定で border-box なので元の値のまま */
  width: 52px;
  height: 52px;
  border: 2px dashed #ddd;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}
.visit-photo-btn:hover { border-color: #aaa; background: #f0f0f0; }

.visit-photo-btn__icon {
  width: 24px;
  height: 24px;
  color: #aaa;
}

.visit-photo-btn__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e95b6b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.visit-photo-btn__badge-icon {
  width: 11px;
  height: 11px;
  display: block;
}

/* ---- Photo panel（他のアコーディオンパネルと同じ位置にインライン表示） ---- */
.visit-photo-panel__list {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  overflow-x: auto;
  max-width: 100%;
  padding: 4px;
  scrollbar-width: none;
}
.visit-photo-panel__list::-webkit-scrollbar { display: none; }

.visit-photo-thumb {
  position: relative;
  flex: 0 0 110px;
  width: 110px;
  height: 110px;
  border-radius: 12px;
  overflow: hidden;
  background: #222;
}

.visit-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.visit-photo-thumb__toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  /* button_to が生成する <button>。UA 既定で border-box なので元の値のまま */
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid #fff;
  color: #fff;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.visit-photo-thumb__toggle svg {
  width: 16px;
  height: 16px;
}
.visit-photo-thumb__toggle.is-public {
  background: #ef7f7f;
}
.visit-photo-thumb__toggle.is-private {
  background: rgba(0, 0, 0, 0.55);
}

.visit-photo-thumb__delete {
  position: absolute;
  bottom: 6px;
  right: 6px;
  /* rating_modal_controller.js が <button> で生成する。UA 既定で border-box */
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.visit-photo-thumb__delete svg {
  width: 14px;
  height: 14px;
}

.visit-photo-add-tile {
  /* rating_modal_controller.js が <button> で生成する。UA 既定で border-box */
  flex: 0 0 64px;
  width: 64px;
  height: 110px;
  border: 2px dashed #ddd;
  border-radius: 12px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 0;
}
.visit-photo-add-tile:hover { border-color: #aaa; background: #f0f0f0; }
.visit-photo-add-tile:focus-visible { outline: 2px solid #ef7f7f; outline-offset: 2px; }

.visit-photo-add-tile.is-empty {
  flex: 0 0 128px;
  width: 128px;
  align-self: flex-start;
  height: 110px;
  padding: 0 8px;
}

.visit-photo-add-tile__plus {
  width: 40px;  /* border 2px 込みの外寸 */
  height: 40px;
  border-radius: 999px;
  background: none;
  border: 2px dashed #ddd;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.visit-photo-add-tile__plus svg {
  width: 20px;
  height: 20px;
}

.visit-photo-add-tile__label {
  display: none;
  font-size: 12px;
  color: #999;
  text-align: center;
  line-height: 1.3;
}
.visit-photo-add-tile.is-empty .visit-photo-add-tile__label {
  display: block;
}

/* ---- Toolbar ---- */
.visit-toolbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}
.visit-toolbar::-webkit-scrollbar { display: none; }

.visit-toolbar__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #f5f5f5;
  border: 1.5px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
  color: #555;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.visit-toolbar__btn:hover { background: #ececec; }
.visit-toolbar__btn.is-active {
  background: #fff0f1;
  border-color: #e95b6b;
  color: #e95b6b;
}

.visit-toolbar__icon {
  width: 20px;
  height: 20px;
}
.visit-toolbar__label { font-size: 11px; }
.visit-toolbar__label.is-filled {
  color: #e95b6b;
  font-weight: 600;
}

/* ---- Accordion panels ---- */
.visit-panel {
  background: #fafafa;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #eee;
}
.visit-panel.is-hidden { display: none; }

.visit-panel__loading,
.visit-panel__empty {
  color: #999;
  font-size: 13px;
  margin: 0;
  padding: 8px 0;
}

/* ---- Calendar ---- */
.visit-calendar { font-size: 14px; }

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cal-prev, .cal-next {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 4px 8px;
  color: #555;
  line-height: 1;
}
.cal-title { font-weight: 600; font-size: 15px; }

.cal-today-btn {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 6px;
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}
.cal-today-btn:hover { background: #e5e5e5; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-dow {
  text-align: center;
  font-size: 12px;
  color: #999;
  padding: 4px 0;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  font-size: 13px;
  color: #333;
  padding: 0;
}
.cal-day:hover { background: #f0f0f0; }
.cal-day.is-empty { cursor: default; background: none; }
.cal-day.is-today { font-weight: 700; color: #e95b6b; }
.cal-day.is-selected {
  background: #e95b6b;
  color: #fff;
  font-weight: 700;
}

/* ---- Folder list ---- */
.visit-folder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.visit-folder-item {
  padding: 6px 14px;
  border: 1.5px solid #ddd;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}
.visit-folder-item:hover { border-color: #aaa; }
.visit-folder-item.is-selected {
  background: #e95b6b;
  border-color: #e95b6b;
  color: #fff;
}

.visit-new-folder-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #e95b6b;
  padding: 4px 0;
  text-decoration: underline;
}

.visit-new-folder-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.visit-new-folder-form.is-hidden { display: none; }

.visit-new-folder-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}
.visit-new-folder-submit {
  padding: 7px 14px;
  background: #e95b6b;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

/* ---- Friends panel ---- */
.visit-friend-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 8px;
}

.visit-friend-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.visit-friend-result {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 5px 12px;
  border: 1.5px solid #ddd;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}
.visit-friend-result__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  flex: 0 0 auto;
}
.visit-friend-result:hover { border-color: #aaa; }
.visit-friend-result.is-selected {
  background: #e95b6b;
  border-color: #e95b6b;
  color: #fff;
}

/* ---- Dish panel ---- */
.visit-dish-entry {
  display: flex;
  gap: 8px;
}
.visit-dish-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}
.visit-dish-add-btn {
  padding: 8px 14px;
  background: #e95b6b;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.visit-dish-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* ---- Label panel ---- */
.visit-label-category { margin-bottom: 10px; }
.visit-label-category__name {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.visit-label-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.visit-label-btn {
  padding: 5px 12px;
  border: 1.5px solid #ddd;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: #444;
  transition: background 0.1s, border-color 0.1s;
}
.visit-label-btn:hover { border-color: #bbb; }
.visit-label-btn.is-selected {
  background: #e95b6b;
  border-color: #e95b6b;
  color: #fff;
}

/* ---- Chips (shared) ---- */
.visit-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 12px;
  background: #f0f0f0;
  border-radius: 999px;
  font-size: 13px;
  color: #333;
}
/* 友人チップのみ。食事チップには img が入らないので影響しない */
.visit-chip__avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  flex: 0 0 auto;
  margin-left: -4px;
}
.visit-chip__remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #888;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}
.visit-chip__remove:hover { color: #e95b6b; }

/* ---- Memo ---- */
.visit-memo__textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  /* iOS のフォーカス時オートズーム回避のため 16px を下回らせない */
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
}
.visit-memo__textarea:focus {
  outline: none;
  border-color: #e95b6b;
}

/* 評価モーダルのメモ／Feed用コメントは既定を1行に畳む（--collapsible が付いた欄だけ）。
   行きたい保存（bookmark-modal）のメモは従来どおり3行のままなので、
   クラスを共有している `.visit-memo__textarea` 側は触らないこと。
   手動リサイズは inline の height を書いて下の展開ルールに勝つので切る。
   rows="3" は CSS 無効時のフォールバックとして HTML に残してある */
.visit-memo__textarea--collapsible {
  height: calc(1.6em + 22px);   /* 1行(1.6em) + padding 10px*2 + border 1px*2 */
  min-height: 0;
  overflow: hidden;
  resize: none;
  transition: height .18s ease;
}
/* タップ（フォーカス）で従来の3行ぶんに開く。入力済みの間も開いたままにして、
   書いたメモが1行に隠れないようにする（値は JS からも入るが :placeholder-shown は追従する） */
.visit-memo__textarea--collapsible:focus,
.visit-memo__textarea--collapsible:not(:placeholder-shown) {
  height: calc(4.8em + 22px);   /* 3行 */
  overflow-y: auto;
}

/* メモ欄の横（右上）に置くFeed公開チェック */
.visit-memo__head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 6px;
}
.visit-memo__publish {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  /* タップ領域を26px程度確保する（見た目は小さいまま） */
  position: relative;
  min-height: 26px;
}
.visit-memo__publish input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #e95b6b;
  margin: 0;
  cursor: pointer;
}

/* ---- Feed用コメント（メモ非公開時のみ表示） ---- */
.visit-feed-comment {
  margin-top: 12px;
}
.visit-feed-comment__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #666;
}

/* ---- Rating sliders ---- */
.visit-ratings {
  display: grid;
  grid-template-columns: 56px 1fr 40px;
  align-items: center;
  column-gap: 12px;
  row-gap: 18px;
}

.rating-field {
  /* 子要素を親の grid にそのまま参加させ、4項目のラベル・スライダー・バッジ幅を揃える */
  display: contents;
}

.rating-field__label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.rating-field__range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #ff4f7b 0%,
    #ff4f7b var(--fill, 50%),
    #ffd9e2 var(--fill, 50%),
    #ffd9e2 100%
  );
  outline: none;
  cursor: pointer;
}
.rating-field__range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: transparent;
}
.rating-field__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border-radius: 50%;
  background: #ff4f7b;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.rating-field__range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: #ffd9e2;
}
.rating-field__range::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: #ff4f7b;
}
.rating-field__range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ff4f7b;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.rating-field__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 28px;
  border-radius: 999px;
  background: #ffe3ea;
  color: #d81b60;
  font-size: 14px;
  font-weight: 700;
}

/* =========================================
   前回比較モード（「さらに評価」）
========================================= */

/* ---- スライダーの前回値ゴースト目盛り ----
   .rating-field は display:contents で箱を持たないため、input をこのラッパーで
   包んで絶対配置の基準にしている。--prev は JS が立てる（立っていないときは
   ::after を出さないので、通常の評価モーダルには影響しない）。 */
.rating-field__track {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

/* 目盛りは前回比較のときだけ出す。.has-prev は JS が .visit-ratings に付け外しするので、
   初回評価・編集モードでは擬似要素自体が生成されない。 */
.visit-ratings.has-prev .rating-field__track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--prev, 50%);
  width: 2px;
  height: 14px;
  margin-top: -7px;
  transform: translateX(-50%);
  border-radius: 1px;
  background: #b0b0bb;
  pointer-events: none;
}

/* ---- 前回との差分バッジ ---- */
.rating-field__delta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.rating-field__delta.is-up   { background: #ffe3ea; color: #d81b60; }
.rating-field__delta.is-down { background: #e3ecff; color: #2a5bd7; }
.rating-field__delta.is-same { background: #eeeef2; color: #86868f; }

/* 差分バッジの列は前回比較のときだけ作る */
.visit-ratings.has-prev {
  grid-template-columns: 56px 1fr 40px 44px;
}

/* ---- ヘッダー下の前回サマリー行 ---- */
.visit-prev {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 8px;
  font-size: 13px;
  color: #666;
}

.visit-prev__badge {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 3px 10px;
  background: #ffe3ea;
  color: #d81b60;
  font-size: 12px;
  font-weight: 700;
}

.visit-prev__score b { color: #333; }

.visit-prev__toggle {
  margin-left: auto;
  border: 0;
  background: none;
  padding: 4px 2px;
  color: #d81b60;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* ---- これまでの記録（行をクリックすると、その過去レビューをフル編集できる） ---- */
.visit-history__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visit-history__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f4;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s;
}
.visit-history__row:hover { background: #f7f7fa; }
.visit-history__row:last-child { border-bottom: 0; padding-bottom: 0; }

/* ---- 過去レビューを直接編集中バナー ---- */
.visit-history-edit-notice {
  margin: 0 0 4px;
  padding: 6px 10px;
  background: #fff6e5;
  color: #8a6d1d;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
}

/* ---- 過去レビュー編集モードでは、bookmarks（店の最新状態）側の項目を隠す ---- */
.is-history-edit-hidden { display: none !important; }

.visit-history__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666;
}

.visit-history__score {
  font-weight: 700;
  color: #d81b60;
}

.visit-history__scores {
  font-size: 12px;
  color: #86868f;
}

.visit-history__note {
  margin: 0;
  font-size: 13px;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

.visit-history__photos {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.visit-history__photo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
}

/* ---- Footer actions ---- */
.visit-sheet__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding-top: 4px;
}
.visit-sheet__cancel,
.visit-sheet__submit {
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.visit-sheet__cancel { background: #f1f1f1; color: #555; }
.visit-sheet__submit { background: #e95b6b; color: #fff; }
.visit-sheet__submit:hover { background: #d44d5d; }

/* =========================================
   汎用ユーティリティ
========================================= */
.is-hidden { display: none !important; }

/* =========================================
   ブックマーク bottom sheet
========================================= */
.bm-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.40);
  display: flex;
  align-items: flex-end;
}
.bm-modal.is-hidden { display: none !important; }

.bm-sheet {
  width: 100%;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 20px 16px;
  /* bottomnav の上に配置。高さは application.css の --bottom-nav-h が持つ
     （以前の 44px は実高 56px に対して12px足りず、シートがナビ下端に潜っていた） */
  margin-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
  max-height: 80dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.14);
}

.bm-sheet__header { margin-bottom: 0; }

.bm-sheet__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

/* =========================================
   ブックマーク削除カウントダウン toast
========================================= */
.bm-toast {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 10000;
  background: #333;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.bm-toast.is-hidden { display: none !important; }

.bm-toast__text { flex: 1; }

.bm-toast__count {
  font-weight: bold;
  min-width: 20px;
  text-align: center;
  font-size: 16px;
}

.bm-toast__undo {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.bm-toast__undo:hover { background: rgba(255, 255, 255, 0.15); }

/* ---- 「さらに評価」保存後のスコア変化トースト（.bm-toast を土台に流用） ---- */
.score-toast__from {
  opacity: 0.7;
  text-decoration: line-through;
}

.score-toast__arrow {
  margin: 0 2px;
  opacity: 0.7;
}

.score-toast__to {
  font-weight: 700;
  font-size: 16px;
}

/* =========================================
   訪問予定モーダル (booking-modal)
========================================= */

/* ---- 店名サブタイトル ---- */
.bk-restaurant-name {
  margin: 0;
  font-size: 13px;
  color: #666;
  padding-top: 2px;
}

/* ---- カレンダーナビ（期間ラベル + 矢印） ---- */
.bk-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bk-cal-nav__arrow {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  color: #333;
  flex-shrink: 0;
  transition: background 0.15s;
}

.bk-cal-nav__arrow:hover:not(:disabled) { background: #ececec; }
.bk-cal-nav__arrow:disabled { opacity: 0.3; cursor: default; }

.bk-cal-nav__label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  flex: 1;
  text-align: center;
}

/* ---- 曜日ヘッダー ---- */
.bk-weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.bk-weekday-header__cell {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  padding: 2px 0;
}

/* ---- カレンダーグリッド（7列 × 2行） ---- */
.bk-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.bk-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 2px;
  background: #f5f5f5;
  border: 1.5px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.bk-day:hover { background: #ececec; }

.bk-day.is-today {
  border-color: #e95b6b;
  color: #e95b6b;
}

.bk-day.is-selected {
  background: #e95b6b;
  border-color: #e95b6b;
  color: #fff;
}

.bk-day__num {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

/* ---- セクションラベル ---- */
.bk-section-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  margin-bottom: 4px;
}

/* ---- ホイールピッカー（時・分・人数） ---- */
/* ホイールピッカー基準高さ: 32px */
.bk-wheel-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px;
}

/* 時間エリア（トリガーボタン or ホイール） */
.bk-time-area {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.bk-time-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: #f5f5f5;
  border: 1.5px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.bk-time-trigger:hover {
  background: #ececec;
}

.bk-time-trigger__val {
  font-size: 22px;
  font-weight: 700;
  color: #222;
  letter-spacing: 2px;
  line-height: 1;
}

.bk-time-wheels {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

/* 人数エリア（トリガーボタン or ホイール） */
.bk-guest-area {
  display: flex;
  align-items: flex-end;
}

.bk-guest-wheels {
  display: flex;
  align-items: flex-end;
}

.bk-wheel-sep {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  padding-bottom: calc(32px * 2 + 2px);
  line-height: 32px;
  flex-shrink: 0;
}

.bk-wheel-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bk-wheel-group--sm {
  width: 64px;
}

.bk-wheel-group--guest {
  width: 80px;
}

.bk-wheel-label {
  font-size: 11px;
  font-weight: 600;
  color: #888;
}

/* 5行分（32px × 5） */
.bk-wheel-body {
  position: relative;
  height: calc(32px * 5);
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: #f5f5f5;
}

/* 中央ハイライトバー */
.bk-wheel-highlight {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(32px * 2);
  height: 32px;
  background: rgba(233, 91, 107, 0.12);
  border-top: 1.5px solid #e95b6b;
  border-bottom: 1.5px solid #e95b6b;
  pointer-events: none;
  z-index: 2;
}

/* スクロールコンテナ */
.bk-wheel-col {
  position: absolute;
  inset: 0;
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.25) 20%,
    black 40%,
    black 60%,
    rgba(0,0,0,0.25) 80%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.25) 20%,
    black 40%,
    black 60%,
    rgba(0,0,0,0.25) 80%,
    transparent 100%
  );
}

.bk-wheel-col::-webkit-scrollbar { display: none; }

/* 上下スペーサー（32px × 2） */
.bk-wheel-spacer {
  height: calc(32px * 2);
  flex-shrink: 0;
}

/* 各アイテム */
.bk-wheel-item {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  color: #222;
  cursor: pointer;
  user-select: none;
}

/* ---- エラー表示 ---- */
.bk-error {
  color: #e95b6b;
  font-size: 13px;
  margin: 0;
}
.bk-error.is-hidden { display: none; }

/* =========================================
   Home reservation list
========================================= */

.reservation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reservation-item {
  background: #f9f9f9;
  border-radius: 12px;
  overflow: hidden;
}

.reservation-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  gap: 8px;
}

.reservation-link:hover { background: #f0f0f0; }

.reservation-name {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reservation-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.reservation-date,
.reservation-time {
  font-size: 13px;
  color: #666;
}

/* =========================================
   写真保存失敗（1回目）インライン表示
========================================= */
.visit-save-error {
  background: #fff0f1;
  border: 1px solid #f3c9cd;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.visit-save-error.is-hidden { display: none; }

.visit-save-error__text {
  flex: 1;
  margin: 0;
  font-size: 13px;
  color: #b33040;
}

.visit-save-error__retry {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: #e95b6b;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.visit-save-error.is-retryable .visit-save-error__retry { display: inline-block; }

/* =========================================
   写真保存失敗（2回目以降）第2階層ポップアップ
========================================= */
.visit-save-popup {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: min(90vw, 360px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.visit-save-popup::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.visit-save-popup__inner {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visit-save-popup__text {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.visit-save-popup__note {
  margin: 0;
  font-size: 12px;
  color: #b33040;
  min-height: 1em;
}

.visit-save-popup__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.visit-save-popup__retry,
.visit-save-popup__investigate {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.visit-save-popup__retry { background: #e95b6b; color: #fff; }
.visit-save-popup__investigate { background: #f0f0f0; color: #444; }
.visit-save-popup__investigate.is-hidden { display: none; }

.visit-save-popup__investigate-note {
  margin: 0;
  font-size: 11px;
  color: #999;
  text-align: center;
}
.visit-save-popup__investigate-note.is-hidden { display: none; }

.visit-save-popup__close {
  border: 0;
  background: none;
  color: #999;
  font-size: 12px;
  padding: 4px 0;
  cursor: pointer;
  text-align: center;
}

/* ---- 訪問記録の削除確認。枠・余白・閉じるボタンは上の .visit-save-popup を共有し、
   説明文と実行ボタンだけ足す（ポップアップの見た目を2箇所に分けない） ---- */
.visit-delete-popup__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #666;
}

.visit-delete-popup__confirm {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  /* ゴミ箱アイコン・他の選択中と同じブランドピンク */
  background: #e95b6b;
  color: #fff;
}
.visit-delete-popup__confirm:disabled {
  opacity: 0.6;
  cursor: default;
}

/* =========================================
   未完了写真の復元バナー
========================================= */
.pending-photo-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 18px);
  z-index: 9998;
  background: #333;
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.pending-photo-banner.is-hidden { display: none; }

.pending-photo-banner__text { flex: 1; }

.pending-photo-banner__resume {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}
.pending-photo-banner__resume:hover { background: rgba(255, 255, 255, 0.15); }

.pending-photo-banner__dismiss {
  background: none;
  border: none;
  color: #ccc;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

/* =========================================
   Tasty共通Glass UI（うるうる＋ぷっくり＋ぷるぷる）— 訪問記録モーダル分

   **body.<controller>.<action> の接頭は付けない。** visit_modal.css は
   layouts/application.html.erb から全画面で読み込まれ、モーダル自体も <body> 直下に
   1つだけ置かれる共通部品なので、接頭を付けるとモーダルを開いた画面によって
   見た目が変わる（notifications.css / profiles.css で実際に「同じ部品なのに
   Home と /notifications で違う」「自分のプロフィールだけガラス」が起きていた）。

   レシピは home.css で最初に作った値をそのまま再利用する（新規考案しない）。
   keyframe は application.css の tastyGlassPulse を参照する。

   対象外（→ application.css の【Glass 化の対象にしない要素】）:
   ・.visit-new-folder-btn / .visit-chip__remove / .visit-save-popup__close /
     .visit-prev__toggle — 素が background: none・角丸なし。白いシートの上では
     板の四角い輪郭がそのまま枠として出るので、タップ演出だけ付ける
   ・.visit-photo-btn — 2px dashed の「写真を追加」プレースホルダ。点線の内側に
     別の塗りが乗ると意図が壊れるため塗りは触らない（タップ演出のみ）
   ・.visit-sheet / 各パネル / .visit-chip__avatar などの容器・画像 — Homeのカード本体と
     同じ「コンテンツ」扱い
========================================= */

/* --- 白/薄グレーのピル・カード型ボタン：Liquid Glass（濃） --- */
.visit-toolbar__btn,
.visit-label-btn,
.visit-delete-btn,
.cal-today-btn,
.visit-chip {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.visit-toolbar__btn::before,
.visit-label-btn::before,
.visit-delete-btn::before,
.cal-today-btn::before,
.visit-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(130% 120% at 20% -25%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.15) 30%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 50%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.visit-toolbar__btn,
.visit-label-btn,
.visit-delete-btn,
.cal-today-btn,
.visit-chip {
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -1px 2px rgba(0, 0, 0, 0.04),
    0 3px 10px rgba(0, 0, 0, 0.12);
}

/* ホバーの塗り（#ececec / #e6e6e6）は上のブロックで不透明に戻ってしまい、
   マウス環境でだけガラスが消えて見える。cards.css の .quick-actions__pill:hover と
   同じ扱いで、透明感を保ったまま少し濃くする（同詳細度なのでこの位置＝後勝ち）。 */
.visit-toolbar__btn:hover,
.visit-delete-btn:hover {
  background: rgba(255, 255, 255, 0.38);
}

/* 選択中の塗りは各自の .is-active / .is-selected ブロック（上）が持っている。
   詳細度が (0,2,0) で上のガラス (0,1,0) に勝つので、ここで色を書き直す必要はない
   （書き直すと色の定義が2箇所に増える）。不透明な塗りの下では backdrop-filter は
   無駄なので切るだけにする。同詳細度なのでこの位置＝後勝ちで効く。 */
.visit-toolbar__btn.is-active,
.visit-label-btn.is-selected {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* --- ブランドカラーのボタン（保存・追加・公開トグル）：背景色は変えず、
   光沢ハイライトと凸面の影だけ重ねて色味を保ったままガラス感を足す。
   .visit-photo-thumb__toggle は .is-public（#ef7f7f）/.is-private（黒半透明）で
   公開状態を色で示しているため、塗りを半透明白に置き換えてはいけない。 --- */
.visit-sheet__submit,
.visit-dish-add-btn,
.visit-new-folder-submit,
.visit-photo-thumb__toggle {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.visit-sheet__submit::before,
.visit-dish-add-btn::before,
.visit-new-folder-submit::before,
.visit-photo-thumb__toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(130% 120% at 20% -25%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.2) 30%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 50%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.visit-sheet__submit,
.visit-dish-add-btn,
.visit-new-folder-submit,
.visit-photo-thumb__toggle {
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    0 3px 10px rgba(0, 0, 0, 0.12);
}

/* --- ぷるぷる：タップ時のオーバーシュート（板を敷いていないボタンにも付ける）。
   .visit-chip 自体は <span>（押せるのは中の .visit-chip__remove だけ）なので入れない。
   入れると ×（これも :active でぷるぷるする）を押したときに親子で二重に弾む。 --- */
.visit-toolbar__btn:active,
.visit-label-btn:active,
.visit-delete-btn:active,
.cal-today-btn:active,
.visit-sheet__submit:active,
.visit-dish-add-btn:active,
.visit-new-folder-submit:active,
.visit-photo-thumb__toggle:active,
.visit-photo-btn:active,
.visit-new-folder-btn:active,
.visit-chip__remove:active,
.visit-save-popup__close:active,
.visit-prev__toggle:active {
  animation: tastyGlassPulse 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: reduce) {
  .visit-toolbar__btn:active,
  .visit-label-btn:active,
  .visit-delete-btn:active,
  .cal-today-btn:active,
  .visit-chip:active,
  .visit-sheet__submit:active,
  .visit-dish-add-btn:active,
  .visit-new-folder-submit:active,
  .visit-photo-thumb__toggle:active,
  .visit-photo-btn:active,
  .visit-new-folder-btn:active,
  .visit-chip__remove:active,
  .visit-save-popup__close:active,
  .visit-prev__toggle:active {
    animation: none;
  }
}

/* ---- Responsive: 写真パネル ---- */
@media (max-width: 768px) {
  .visit-photo-thumb {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
  }
  .visit-photo-add-tile {
    width: 56px;
    height: 96px;
    flex: 0 0 56px;
  }
  .visit-photo-add-tile.is-empty {
    width: 112px;
    flex: 0 0 112px;
    height: 96px;
  }
}
