/* ============================================================
   グルメ手帳 - 旅好き × 図書館 古書風デザイン
   フォント16px以上、ボタン44px以上、コントラスト比4.5:1以上
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;700&display=swap');

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

body {
  font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  font-size: 18px;
  line-height: 1.6;
  color: #2c1810;
  background-color: #f0e6d3;
  padding-bottom: 68px;
  background-image:
    repeating-linear-gradient(
      0deg, transparent, transparent 40px,
      rgba(160, 130, 90, 0.04) 40px,
      rgba(160, 130, 90, 0.04) 41px
    );
}

/* ヘッダー */
.app-header {
  background: linear-gradient(180deg, #3c2415 0%, #4a2e1a 100%);
  color: #f0e6d3;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid #8b6914;
  box-shadow: 0 2px 12px rgba(44, 24, 16, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-title {
  font-size: 24px;
  text-align: center;
  margin-bottom: 0;
  font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', serif;
  letter-spacing: 0.15em;
  color: #e8d5b7;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* ヘッダーログアウトボタン */
.header-logout-btn {
  min-height: 44px;
  font-size: 16px;
  background: transparent;
  color: #e8d5b7;
  border: 1px solid rgba(232, 213, 183, 0.3);
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'Noto Serif JP', serif;
  transition: background-color 0.2s;
}

.header-logout-btn:hover,
.header-logout-btn:focus {
  background: rgba(232, 213, 183, 0.15);
  outline: 2px solid #e8d5b7;
  outline-offset: 2px;
}

.app-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.nav-btn {
  font-size: 16px;
  padding: 12px 20px;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid rgba(232, 213, 183, 0.3);
  border-radius: 4px;
  background-color: rgba(232, 213, 183, 0.1);
  color: #e8d5b7;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: 'Noto Serif JP', serif;
  letter-spacing: 0.1em;
}

.nav-btn:hover,
.nav-btn:focus {
  background-color: rgba(232, 213, 183, 0.25);
  outline: 2px solid #e8d5b7;
  outline-offset: 2px;
}

.nav-btn.active {
  background-color: #e8d5b7;
  color: #3c2415;
  font-weight: bold;
  border-color: #8b6914;
}

/* メインコンテンツ */
.app-content {
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
}

/* カード */
.card {
  background: #faf5eb;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(44, 24, 16, 0.1);
  border: 1px solid #d4c5a9;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 3px 12px rgba(44, 24, 16, 0.18);
}

.card-name {
  font-size: 20px;
  font-weight: bold;
  color: #2c1810;
  margin-bottom: 8px;
}

.card-genre {
  font-size: 16px;
  color: #6b5340;
  margin-bottom: 8px;
}

.card-stars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
}

.star-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.star-label {
  min-width: 80px;
  color: #6b5340;
}

/* フォーム */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 18px;
  font-weight: bold;
  color: #3c2415;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  font-size: 18px;
  padding: 12px 16px;
  border: 1px solid #c4b59a;
  border-radius: 4px;
  background-color: #faf5eb;
  color: #2c1810;
  min-height: 44px;
  font-family: 'Noto Serif JP', serif;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #8b6914;
  outline: 2px solid rgba(139, 105, 20, 0.3);
  outline-offset: 1px;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.required::after {
  content: ' *';
  color: #8b2500;
}

.error-text {
  color: #8b2500;
  font-size: 16px;
  margin-top: 4px;
}

/* ボタン */
.btn {
  font-size: 18px;
  padding: 14px 28px;
  min-height: 48px;
  min-width: 44px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Noto Serif JP', serif;
}

.btn-primary {
  background-color: #5a3e28;
  color: #f0e6d3;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #3c2415;
}

.btn-secondary {
  background-color: #8b7355;
  color: #f0e6d3;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #6b5340;
}

.btn-danger {
  background-color: #8b2500;
  color: #f0e6d3;
}

.btn-danger:hover,
.btn-danger:focus {
  background-color: #6b1c00;
}

.btn:focus {
  outline: 2px solid #8b6914;
  outline-offset: 2px;
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* 検索 */
.search-bar {
  margin-bottom: 20px;
}

.search-bar input {
  width: 100%;
  font-size: 18px;
  padding: 12px 16px;
  border: 1px solid #c4b59a;
  border-radius: 4px;
  min-height: 44px;
  background-color: #faf5eb;
  font-family: 'Noto Serif JP', serif;
}

/* 空メッセージ */
.empty-message {
  text-align: center;
  padding: 40px 20px;
  color: #8b7355;
  font-size: 18px;
}

/* 詳細画面 */
.detail-field {
  margin-bottom: 16px;
}

.detail-label {
  font-size: 16px;
  color: #6b5340;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 18px;
  color: #2c1810;
}

.detail-photo {
  max-width: 100%;
  border-radius: 4px;
  margin: 12px 0;
  border: 1px solid #d4c5a9;
}

/* ローディング */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(240, 230, 211, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  font-size: 18px;
  color: #3c2415;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #d4c5a9;
  border-top-color: #5a3e28;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* トースト通知 */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #3c2415;
  color: #f0e6d3;
  padding: 14px 28px;
  border-radius: 4px;
  font-size: 16px;
  z-index: 300;
  transition: opacity 0.3s;
}

.toast.error {
  background-color: #8b2500;
}

.hidden {
  display: none !important;
}

/* 確認ダイアログ */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 24, 16, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
}

.dialog {
  background: #faf5eb;
  border-radius: 4px;
  padding: 28px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  border: 1px solid #d4c5a9;
}

.dialog p {
  font-size: 18px;
  margin-bottom: 20px;
}

/* 設定画面 */
.setting-item {
  background: #faf5eb;
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(44, 24, 16, 0.1);
  border: 1px solid #d4c5a9;
}

/* レスポンシブ: PC（768px以上）でグリッド */
@media (min-width: 768px) {
  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
  }

  .card {
    margin-bottom: 0;
  }
}

/* スマホ: シングルカラム（デフォルト） */
@media (max-width: 767px) {
  .app-content {
    padding: 16px;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* ============================================================
   本型UI: 自分だけのグルメ本 (StPageFlip)
   ============================================================ */

.book-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.book-wrapper {
  display: block;
}

/* 全ページ共通: 古紙の質感 */
.page {
  background: #f5eed8;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-image:
    repeating-linear-gradient(
      0deg, transparent, transparent 28px,
      rgba(160, 130, 90, 0.06) 28px,
      rgba(160, 130, 90, 0.06) 29px
    );
  border: 1px solid #c4b59a;
}

/* 表紙・裏表紙: 革風ハードカバー */
.page-cover, .page-back-cover {
  background: linear-gradient(170deg, #4a2e1a 0%, #5a3e28 30%, #3c2415 70%, #2c1810 100%);
  background-image: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.3);
}

.cover-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(139, 105, 20, 0.4);
  border-radius: 2px;
  margin: 12px;
}

.cover-decoration-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8b6914, transparent);
  margin-bottom: 20px;
}

.cover-title {
  font-size: 24px; font-weight: bold; color: #e8d5b7;
  font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', serif;
  letter-spacing: 0.12em; margin-bottom: 14px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}
.cover-divider { color: #8b6914; font-size: 14px; margin-bottom: 14px; letter-spacing: 0.3em; }
.cover-count { font-size: 15px; color: #d4c5a9; }

/* 写真エリア */
.page-photo { width: 100%; height: 180px; overflow: hidden; background: #e8dcc8; flex-shrink: 0; }
.page-photo-img { width: 100%; height: 100%; object-fit: cover; }
.page-photo-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 16px; color: #8b7355;
}

/* 店舗情報 */
.page-info { padding: 12px 14px; flex: 1; overflow-y: auto; }
.page-name {
  font-size: 20px; font-weight: bold; color: #2c1810; margin-bottom: 4px;
  font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', serif;
}
.page-genre {
  display: inline-block; font-size: 13px; color: #6b5340;
  background: rgba(107, 83, 64, 0.1); padding: 2px 8px; border-radius: 4px; margin-bottom: 6px;
}
.page-date { display: block; font-size: 13px; color: #8b7355; margin-bottom: 8px; }

.page-stars { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; }
.page-star-row { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.page-star-label { min-width: 52px; color: #6b5340; font-size: 13px; }

/* 下部 */
.page-bottom { padding: 0 14px 8px; }
.page-location { margin-bottom: 6px; }
.page-map-link { color: #5a3e28; text-decoration: none; font-size: 13px; border-bottom: 1px dotted #8b7355; }
.page-map-link:hover { color: #8b6914; }
.page-comment {
  font-size: 14px; color: #3c2415; line-height: 1.7; padding: 6px 10px;
  background: rgba(107, 83, 64, 0.05); border-left: 3px solid #8b6914;
  border-radius: 0 4px 4px 0;
  font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', serif; font-style: italic;
}

/* アクションボタン */
.page-actions { display: flex; gap: 8px; padding: 8px 14px; justify-content: center; flex-shrink: 0; }
.page-actions .btn { font-size: 14px; padding: 10px 20px; min-height: 44px; }

/* 新規登録ページ */
.page-add {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: #6b5340;
}
.page-add-icon { font-size: 44px; margin-bottom: 14px; color: #8b6914; font-weight: bold; }

/* 空メッセージページ */
.page-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: #6b5340; text-align: center; padding: 20px;
}

/* 空白ページ */
.page-blank { background: #f5eed8; min-height: 100%; }

/* ナビゲーションボタン */
.book-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 12px; padding: 0 8px;
}
.book-nav-btn {
  font-size: 15px; padding: 10px 18px; min-height: 44px; min-width: 44px;
  border: 1px solid #c4b59a; border-radius: 4px;
  background: #faf5eb; color: #5a3e28; cursor: pointer;
  transition: background 0.2s;
  font-family: 'Noto Serif JP', serif;
}
.book-nav-btn:hover { background: #f0e6d3; }
.book-nav-btn:focus { outline: 2px solid #8b6914; outline-offset: 2px; }
.book-page-info { font-size: 14px; color: #6b5340; min-width: 60px; text-align: center; }

/* ============================================================
   Swiperモード用CSS
   ============================================================ */

.book-swiper {
  width: 100%;
  padding-bottom: 40px;
}

.swiper-slide .page {
  background: #f5eed8;
  border-radius: 4px;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background-image:
    repeating-linear-gradient(
      0deg, transparent, transparent 28px,
      rgba(160, 130, 90, 0.06) 28px,
      rgba(160, 130, 90, 0.06) 29px
    );
  box-shadow:
    2px 0 8px rgba(44, 24, 16, 0.12),
    inset -2px 0 4px rgba(44, 24, 16, 0.04);
}

.cover-inner-swiper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 70vh;
  background: linear-gradient(170deg, #f0e6d3 0%, #f5eed8 50%, #f0e6d3 100%);
  border: 1px solid #c4b59a;
  padding: 24px;
}

.swiper-slide .page-add,
.swiper-slide .page-empty {
  min-height: 70vh;
}

.book-swiper .swiper-pagination-bullet { background: #c4b59a; opacity: 0.5; }
.book-swiper .swiper-pagination-bullet-active { background: #5a3e28; opacity: 1; }

/* ============================================================
   設定画面: モード切替UI
   ============================================================ */

.flip-mode-options {
  display: flex; gap: 12px; margin-top: 8px;
}

.flip-mode-label {
  flex: 1; cursor: pointer;
}

.flip-mode-label input[type="radio"] {
  display: none;
}

.flip-mode-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 16px 8px; border: 1px solid #c4b59a;
  border-radius: 4px; background: #faf5eb;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.flip-mode-label input:checked + .flip-mode-card {
  border-color: #8b6914; background: #f5eed8;
}

.flip-mode-name {
  font-size: 16px; font-weight: bold; color: #3c2415;
}

.flip-mode-desc {
  font-size: 13px; color: #8b7355;
}

/* ============================================================
   ボトムナビゲーション
   ============================================================ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: linear-gradient(0deg, #3c2415 0%, #4a2e1a 100%);
  border-top: 2px solid #8b6914;
  padding: 4px 0;
  height: 64px;
}

.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: #c4b59a;
  cursor: pointer;
  padding: 6px 0;
  min-height: 48px;
  transition: color 0.2s;
  font-family: 'Noto Serif JP', serif;
}

.bottom-nav-btn:hover,
.bottom-nav-btn:focus {
  color: #e8d5b7;
  outline: none;
}

.bottom-nav-btn.active {
  color: #e8d5b7;
}

.bottom-nav-btn.active .bottom-nav-icon {
  color: #8b6914;
}

.bottom-nav-icon {
  font-size: 22px;
  line-height: 1;
}

.bottom-nav-label {
  font-size: 11px;
  letter-spacing: 0.05em;
}

/* ============================================================
   検索オーバーレイ（Google風）
   ============================================================ */

.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 64px;
  z-index: 150;
  background: rgba(44, 24, 16, 0.5);
  display: flex;
  flex-direction: column;
}

.search-overlay-inner {
  background: #f0e6d3;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100vh;
}

.search-overlay-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #faf5eb;
  border-bottom: 1px solid #d4c5a9;
  box-shadow: 0 2px 8px rgba(44, 24, 16, 0.1);
}

.search-overlay-input {
  flex: 1;
  font-size: 18px;
  padding: 12px 16px;
  border: 1px solid #c4b59a;
  border-radius: 24px;
  background: #faf5eb;
  color: #2c1810;
  min-height: 48px;
  font-family: 'Noto Serif JP', serif;
  outline: none;
}

.search-overlay-input:focus {
  border-color: #8b6914;
  box-shadow: 0 0 0 2px rgba(139, 105, 20, 0.2);
}

.search-overlay-cancel {
  font-size: 16px;
  padding: 10px 16px;
  min-height: 44px;
  background: none;
  border: none;
  color: #5a3e28;
  cursor: pointer;
  font-family: 'Noto Serif JP', serif;
  white-space: nowrap;
}

.search-overlay-cancel:hover {
  color: #8b6914;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.search-hint {
  text-align: center;
  padding: 40px 20px;
  color: #8b7355;
  font-size: 16px;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 1px solid #e8dcc8;
  cursor: pointer;
  text-align: left;
  font-family: 'Noto Serif JP', serif;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: #faf5eb;
}

.search-result-name {
  font-size: 17px;
  color: #2c1810;
  font-weight: bold;
}

.search-result-genre {
  font-size: 14px;
  color: #8b7355;
}

/* ============================================================
   縦スクロール制御
   ============================================================ */

body.no-scroll {
  overflow: hidden;
}

body.no-scroll .app-content {
  overflow: hidden;
}

/* トーストをボトムナビの上に表示 */
.toast {
  bottom: 80px;
}

/* ============================================================
   インポート画面
   ============================================================ */

.import-page {
  max-width: 600px;
  margin: 0 auto;
}

.import-title {
  font-size: 22px;
  color: #2c1810;
  margin-bottom: 8px;
  font-family: 'Noto Serif JP', serif;
}

.import-desc {
  font-size: 16px;
  color: #6b5340;
  margin-bottom: 20px;
  line-height: 1.7;
}

.import-upload-area {
  text-align: center;
  padding: 28px 20px;
  background: #faf5eb;
  border: 2px dashed #c4b59a;
  border-radius: 8px;
  margin-bottom: 20px;
}

.import-file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  padding: 14px 28px;
  background: #5a3e28;
  color: #f0e6d3;
  border-radius: 4px;
  cursor: pointer;
  min-height: 48px;
  font-family: 'Noto Serif JP', serif;
}

.import-file-label:hover {
  background: #3c2415;
}

.import-file-input {
  display: none;
}

.import-file-hint {
  font-size: 14px;
  color: #8b7355;
  margin-top: 10px;
}

.import-file-icon {
  font-size: 22px;
}

.import-summary {
  font-size: 17px;
  color: #2c1810;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: #faf5eb;
  border-radius: 4px;
  border: 1px solid #d4c5a9;
}

.import-dup-note {
  color: #8b7355;
  font-size: 15px;
}

.import-list {
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 16px;
}

.import-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e8dcc8;
  background: #faf5eb;
  transition: opacity 0.2s;
}

.import-item-excluded {
  opacity: 0.4;
  background: #f0e6d3;
}

.import-item-dup {
  border-left: 3px solid #8b7355;
}

.import-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.import-item-name {
  font-size: 17px;
  color: #2c1810;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-item-addr {
  font-size: 14px;
  color: #8b7355;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-item-badge {
  font-size: 12px;
  color: #f0e6d3;
  background: #8b7355;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  width: fit-content;
}

.import-item-toggle {
  font-size: 24px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: none;
  background: none;
  color: #8b2500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.import-item-excluded .import-item-toggle {
  color: #5a3e28;
}

.import-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.import-selected-count {
  font-size: 16px;
  color: #6b5340;
}

/* プログレスバー */
.import-progress {
  margin: 16px 0;
}

.import-progress-bar {
  width: 100%;
  height: 12px;
  background: #e8dcc8;
  border-radius: 6px;
  overflow: hidden;
}

.import-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5a3e28, #8b6914);
  border-radius: 6px;
  transition: width 0.3s;
}

.import-progress-text {
  font-size: 15px;
  color: #6b5340;
  text-align: center;
  margin-top: 8px;
}

/* インポート結果 */
.import-result-card {
  background: #faf5eb;
  border: 1px solid #d4c5a9;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.import-result-card h3 {
  font-size: 20px;
  color: #2c1810;
  margin-bottom: 16px;
}

.import-result-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.import-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.import-stat-num {
  font-size: 28px;
  font-weight: bold;
  color: #5a3e28;
}

.import-stat-label {
  font-size: 14px;
  color: #8b7355;
}

.import-errors {
  text-align: left;
  font-size: 14px;
  color: #8b2500;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(139, 37, 0, 0.05);
  border-radius: 4px;
}

.import-errors ul {
  margin: 4px 0 0 20px;
}

/* ============================================================
   平均点表示
   ============================================================ */

.page-avg-score {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  padding: 4px 0;
}

.page-avg-label {
  font-size: 14px;
  color: #6b5340;
  min-width: 36px;
}

.page-avg-stars {
  font-size: 22px;
  letter-spacing: 1px;
}

.page-avg-num {
  font-size: 20px;
  font-weight: bold;
  color: #5a3e28;
}

.page-avg-value {
  font-size: 16px;
  color: #8b7355;
}

.star-filled {
  color: #8b6914;
}

.star-empty {
  color: #d4c5a9;
}

/* ============================================================
   読み取り専用フィールド
   ============================================================ */

.field-readonly {
  background-color: #e8dcc8 !important;
  color: #6b5340 !important;
  cursor: not-allowed;
}

.import-readonly-note {
  font-size: 15px;
  color: #8b7355;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(139, 105, 20, 0.08);
  border-radius: 4px;
  border-left: 3px solid #8b6914;
}

/* ============================================================
   目次ページ
   ============================================================ */

.page-index {
  overflow-y: auto;
}

.index-page {
  padding: 16px 14px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.index-header {
  margin-bottom: 10px;
}

.index-title {
  font-size: 20px;
  color: #2c1810;
  margin-bottom: 8px;
  font-family: 'Noto Serif JP', serif;
  text-align: center;
  letter-spacing: 0.15em;
}

.index-sort-btns {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.index-sort-btn {
  font-size: 13px;
  padding: 6px 12px;
  min-height: 32px;
  border: 1px solid #c4b59a;
  border-radius: 4px;
  background: #faf5eb;
  color: #6b5340;
  cursor: pointer;
  font-family: 'Noto Serif JP', serif;
}

.index-sort-btn.active {
  background: #5a3e28;
  color: #f0e6d3;
  border-color: #5a3e28;
}

.index-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.index-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  border-bottom: 1px dotted #d4c5a9;
  cursor: pointer;
  transition: background 0.15s;
}

.index-item:hover {
  background: rgba(139, 105, 20, 0.06);
}

.index-item-name {
  font-size: 15px;
  color: #2c1810;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}

.index-item-stars {
  font-size: 14px;
  flex-shrink: 0;
}

.index-no-rating {
  font-size: 12px;
  color: #8b7355;
}

.index-pref-header {
  font-size: 14px;
  font-weight: bold;
  color: #5a3e28;
  padding: 8px 6px 4px;
  border-bottom: 1px solid #c4b59a;
  background: rgba(139, 105, 20, 0.04);
}

.index-page-num {
  text-align: center;
  font-size: 13px;
  color: #8b7355;
  margin-top: 8px;
}

/* ============================================================
   認証関連スタイル（Cognito Google認証）
   要件 5.1: 表紙ページのGoogleログインボタン
   要件 5.2: 未ログイン時ボトムナビ非表示
   ============================================================ */

/* Googleログインボタン */
.btn-google-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  min-width: 44px;
  padding: 14px 32px;
  font-size: 18px;
  font-family: 'Noto Serif JP', serif;
  color: #3c2415;
  background: #ffffff;
  border: 2px solid #d4c5a9;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(44, 24, 16, 0.15);
  transition: box-shadow 0.2s, border-color 0.2s;
  letter-spacing: 0.05em;
}

.btn-google-login:hover,
.btn-google-login:focus {
  border-color: #8b6914;
  box-shadow: 0 4px 16px rgba(44, 24, 16, 0.25);
  outline: 2px solid #8b6914;
  outline-offset: 2px;
}

/* Googleアイコン（SVG） */
.google-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ボトムナビ非表示（未ログイン時） */
.bottom-nav.hidden {
  display: none;
}

/* ログアウトボタン（設定ページ内） */
.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  min-width: 44px;
  padding: 14px 28px;
  font-size: 18px;
  font-family: 'Noto Serif JP', serif;
  color: #f0e6d3;
  background-color: #8b2500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
  margin-top: 20px;
}

.btn-logout:hover,
.btn-logout:focus {
  background-color: #6b1c00;
  outline: 2px solid #8b6914;
  outline-offset: 2px;
}

/* ============================================================
   Autocomplete ドロップダウン
   古書風デザイン、シニア向けUI基準（44px以上タップ領域、16px以上フォント）
   ============================================================ */

.autocomplete-wrapper {
  position: relative;
}

.autocomplete-spinner {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 3px solid #d4c5a9;
  border-top-color: #5a3e28;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.autocomplete-list {
  position: absolute;
  z-index: 50;
  width: 100%;
  max-height: 320px;
  overflow-y: auto;
  background: #faf5eb;
  border: 1px solid #c4b59a;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.15);
  font-family: 'Noto Serif JP', serif;
}

.autocomplete-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  min-height: 48px;
  cursor: pointer;
  border-bottom: 1px solid #e8dcc8;
  transition: background 0.15s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item:focus {
  background: #f0e6d3;
}

.autocomplete-item-name {
  font-size: 17px;
  font-weight: bold;
  color: #2c1810;
  line-height: 1.4;
}

.autocomplete-item-addr {
  font-size: 14px;
  color: #6b5340;
  line-height: 1.3;
}

.form-group {
  position: relative;
}

/* ============================================================
   検索FABボタン
   ============================================================ */

.fab-search {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 110;
  width: 56px;
  height: 56px;
  min-height: 48px;
  border-radius: 50%;
  background: #5a3e28;
  color: #f0e6d3;
  font-size: 24px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, box-shadow 0.2s;
  font-family: 'Noto Serif JP', serif;
}

.fab-search:hover,
.fab-search:focus {
  background: #3c2415;
  box-shadow: 0 6px 16px rgba(44, 24, 16, 0.4);
  outline: 2px solid #8b6914;
  outline-offset: 2px;
}

/* ============================================================
   ページ番号（要件4）
   ============================================================ */

.page-number {
  text-align: center;
  font-size: 14px;
  color: #8b7355;
  padding: 4px 0;
  margin-top: auto;
  font-family: 'Georgia', serif;
  letter-spacing: 0.05em;
}
