/* =========================================
   訪問記録モーダル (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;
  padding: 20px 16px 32px;
  box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.14);
  max-height: 92dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- Sticky top (header + toolbar) ---- */
.visit-sheet__sticky-top {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  padding-bottom: 8px;
}

/* ---- 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;
}

/* ---- Photo button ---- */
.visit-photo-btn {
  flex-shrink: 0;
  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__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- 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; }

/* ---- 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: 13px;
}
.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: 14px;
  margin-bottom: 8px;
}

.visit-friend-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.visit-friend-result {
  padding: 5px 12px;
  border: 1.5px solid #ddd;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}
.visit-friend-result:hover { border-color: #aaa; }
.visit-friend-result.is-selected {
  background: #4f6fbf;
  border-color: #4f6fbf;
  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: 14px;
}
.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;
}
.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;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
}
.visit-memo__textarea:focus {
  outline: none;
  border-color: #e95b6b;
}

/* ---- Rating sliders ---- */
.visit-ratings {
  display: grid;
  gap: 14px;
}

/* ---- 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 の上に配置（bottomnav 高さ約 44px + padding 10px + safe-area） */
  margin-bottom: calc(44px + 10px + env(safe-area-inset-bottom, 0px));
  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(44px + 10px + env(safe-area-inset-bottom, 0px));
  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); }

/* =========================================
   訪問予定モーダル (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;
}
