:root {
  --bg: #faf8f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f4f0;
  --ink: #3a3530;
  --muted: #8a8379;
  --dim: #b5aea3;
  --panel: rgba(255, 255, 255, 0.95);
  --line: rgba(0, 0, 0, 0.06);
  --accent: #b8a07a;
  --accent-hover: #a08b67;
  --accent-light: rgba(184, 160, 122, 0.12);
  --rakuten: #c9404a;
  --yahoo: #8a5bc0;
  --amazon: #232f3e;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.08);
  --font-jp: "IBM Plex Sans JP", sans-serif;
  --font-display: "Outfit", "Helvetica Neue", sans-serif;
  --font-serif: "Playfair Display", "IBM Plex Sans JP", serif;
  --font-round: "M PLUS Rounded 1c", "ヒラギノ丸ゴ ProN", "Hiragino Maru Gothic ProN", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-jp);
  font-weight: 400;
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.page {
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 2.5rem) 0 4rem;
}

/* ============================================================
 * Hero / ヘッダー
 * ============================================================ */
.hero {
  padding: 0 0 1.5rem;
  text-align: center;
  animation: fade-up 0.7s ease both;
  position: relative;
  z-index: 100;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  gap: 1rem;
  margin-bottom: 0.8rem;
  padding: 0 3.5rem;
}

.brand-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.brand-banner {
  display: block;
  height: clamp(48px, 8vw, 72px);
  width: auto;
  /* 画像の白い背景をページの背景色に溶け込ませる
     （白は multiply で消え、線画部分だけが残る） */
  mix-blend-mode: multiply;
}

.brand-link:hover .brand-banner {
  opacity: 0.7;
}

/* ============================================================
 * ハンバーガーメニュー（右上）
 * ============================================================ */
.hamburger-container {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 110;
}

.hamburger-btn {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
  line-height: 1;
}

.hamburger-btn:hover {
  background: var(--bg-hover);
}

.hamburger-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.3rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 180px;
}

.hamburger-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

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

.hamburger-item:hover {
  background: var(--bg-hover);
}

/* ============================================================
 * 通知設定バー
 * ============================================================ */
.notif-bar {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* http接続などPush通知が使えない環境での案内メモ */
.push-not-available-note {
  flex-basis: 100%;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  padding: 0.4rem 0.55rem;
  background: rgba(0, 0, 0, 0.045);
  border-radius: 6px;
}

/* iOSスタイルのトグルスイッチ */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 14px;
  background: #d1d1d6;
  transition: background 0.25s ease;
}

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* オン状態 */
.toggle-input:checked + .toggle-track {
  background: #4cd964;
}

.toggle-input:checked + .toggle-track .toggle-knob {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
}

.toggle-input:checked ~ .toggle-label {
  color: var(--accent);
}

/* 非活性 */
.toggle-input:disabled + .toggle-track {
  opacity: 0.5;
}

.toggle-input:disabled ~ .toggle-label {
  color: var(--muted);
}

/* 初回訪問時などの通知承認ポップアップ（通知設定ON・権限未決定の場合） */
.push-enable-banner {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.push-enable-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.push-enable-content {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  width: 90%;
  max-width: 360px;
}

.push-enable-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.push-enable-text {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

.push-enable-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.push-enable-btn {
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.push-enable-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.push-enable-later {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.push-test-btn {
  padding: 0.35rem 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.push-test-btn:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.push-test-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.delete-data-btn {
  padding: 0.35rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.delete-data-btn:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.notif-actions {
  display: inline-flex;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
  align-items: center;
}

/* レート制限トースト */
.rate-limit-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: #fff8e1;
  border-bottom: 2px solid #ffc107;
  color: #5d3a00;
  font-size: 0.85rem;
  line-height: 1.45;
  animation: rateLimitToastIn 0.35s ease-out;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@keyframes rateLimitToastIn {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.rate-limit-toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.rate-limit-toast-text {
  flex: 1;
}

.rate-limit-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: #999;
  padding: 0 0.2rem;
  transition: color 0.15s;
}

.rate-limit-toast-close:hover {
  color: #333;
}

.favorite-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.favorite-item:first-child {
  border-top: none;
  padding-top: 0;
}

.favorite-item.has-update {
  background: rgba(160, 192, 120, 0.07);
  border-radius: 10px;
  padding: 0.65rem 0.55rem;
}

.favorite-thumb {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #f0ece7;
  object-fit: contain;
}

.favorite-info {
  flex: 1;
  min-width: 0;
}

.favorite-name {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.favorite-price-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.favorite-price {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}

.favorite-update-badge {
  display: inline-flex;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #a0c078;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

.favorite-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.favorite-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.favorite-link:hover {
  text-decoration: underline;
}

.favorite-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
}

.favorite-remove:hover {
  color: #c9404a;
}

/* ============================================================
 * ヘッドライン
 * ============================================================ */
.headline {
  margin: 0 0 1.75rem;
  font-family: var(--font-jp);
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  line-height: 1.7;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* キャッチコピー下の小さな注記（ポイントは基本倍率ベースの概算値） */
.hero-note {
  margin: -1rem auto 1.5rem;
  max-width: 480px;
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-muted, #999);
  line-height: 1.5;
  transform: translateX(-8px);
}

/* ============================================================
 * 検索パネル
 * ============================================================ */
.search-panel {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}

.search-label {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.search-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  z-index: 100;
  flex: 1 1 200px;
}

.search-input {
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 3rem 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  z-index: 101;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.search-clear:hover,
.search-clear:active {
  background: var(--dim);
  color: var(--ink);
}

.search-input::placeholder {
  color: var(--dim);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-button {
  min-height: 50px;
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}

.search-button:hover {
  background: var(--accent-hover);
}

.search-button:active {
  transform: translateY(1px);
}

/* ============================================================
 * 結果エリア
 * ============================================================ */
.results {
  margin-top: 0.5rem;
  animation: fade-up 0.85s ease 0.16s both;
}

/* ============================================================
 * 商品グリッド
 * ============================================================ */
.result-section {
  margin-bottom: 2.5rem;
}

.result-section:last-child {
  margin-bottom: 0;
}

.result-section[hidden] {
  display: none;
}

.result-section-header {
  margin-bottom: 1.25rem;
}

.result-section-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.25rem;
}

.sort-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.sort-label {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.sort-toggle {
  padding: 0.3rem 0.65rem;
  font-family: var(--font-jp);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  user-select: none;
}

.sort-toggle:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.sort-toggle.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.result-section-header p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

/* フィルターバー */
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.filter-toggle {
  padding: 0.3rem 0.65rem;
  font-family: var(--font-jp);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  user-select: none;
}

.filter-toggle:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.filter-toggle.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.filter-price-group {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.filter-price-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.filter-price-input {
  width: 64px;
  padding: 0.3rem 0.4rem;
  font-family: var(--font-jp);
  font-size: 0.75rem;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: right;
  -moz-appearance: textfield;
}

.filter-price-input::-webkit-inner-spin-button,
.filter-price-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.filter-price-input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-price-input::placeholder {
  color: #c0c0c0;
  font-size: 0.65rem;
}

.filter-price-sep {
  font-size: 0.75rem;
  color: var(--muted);
}

.filter-apply {
  padding: 0.3rem 0.6rem;
  font-family: var(--font-jp);
  font-size: 0.72rem;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.filter-apply:hover {
  opacity: 0.85;
}

/* モバイル: フィルター折り返し */
@media (max-width: 640px) {
  .filter-bar {
    gap: 0.3rem;
  }
  .filter-price-input {
    width: 56px;
  }
  /* モバイル: ソート系ボタンを折り返して横はみ出しを防ぐ。
     検索保存ボタン（この検索を保存）は下の行に段落落ちさせる */
  .sort-bar {
    gap: 0.35rem;
  }
  .search-save-inline-btn {
    flex-basis: 100%;
    margin-left: 0;
  }
}

/* フィルターバー */
.page-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.page-tab {
  position: relative;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-jp);
  font-size: 1.05rem;
  font-weight: 500;
  text-align: center;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.page-tab:hover {
  color: #c9404a;
}

.page-tab.active {
  color: #c9404a;
  border-bottom-color: #c9404a;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  margin-left: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  background: #c9404a;
  border-radius: 999px;
  line-height: 1;
}

.page-carousel {
  position: relative;
  overflow: hidden;
}

.panel-page {
  display: none;
}

.panel-page.active {
  display: block;
}

/* page-tabs / page-carousel が hidden のときは display: none で隠す
   （display: flex が hidden 属性より優先されるため） */
.page-tabs[hidden],
.page-carousel[hidden] {
  display: none !important;
}

.panel-empty-message {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 2rem 1rem;
  line-height: 1.7;
}

/* ホームパネル（PC: ページタブ / スマホ: ホームタブ）
   今値下げされた商品と最近よく検索される商品を交互に表示 */
#panel-home {
  padding-top: 0.5rem;
}
.home-products-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.25rem;
}
.home-products-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

/* 「最近見た商品」見出し（履歴パネル）
   PCではページタブに名前があるため非表示。
   スマホの履歴タブではボトムナビの下で内容が分かるように表示する。 */
.history-products-heading {
  display: none;
}

/* 検索通知カード（通知する商品タブ内） */
.search-alert-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
  min-height: 60px;
}
.search-alert-card-body {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}
.search-alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.search-alert-info {
  min-width: 0;
}
.search-alert-keyword {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  word-break: break-all;
}
.search-alert-range {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.search-alert-delete {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--line);
  color: #c0392b;
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.search-alert-delete:hover {
  background: #fdf0ee;
  border-color: #e74c3c;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem 1.5rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0 0 1rem;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  box-shadow: var(--shadow);
}

.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f7f4f0;
  overflow: hidden;
}

.product-image.has-photo a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.product-image.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
  transition: transform 0.35s ease;
}

.product-card:hover .product-image.has-photo img {
  transform: scale(1.06);
}

.product-image:not(.has-photo)::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 35%, rgba(255, 255, 255, 0.15), transparent 45%);
}

.product-grid.is-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ============================================================
 * 検索中オーバーレイ
 * ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  animation: pulse-text 1.2s ease-in-out infinite;
}

/* 検索中の補足文言（「検索中…」の下に表示） */
.loading-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
  animation: pulse-text 1.2s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* 検索ノート内のインラインスピナー */
.note-spinner {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.35em;
  position: relative;
  top: -1px;
}

/* ============================================================
 * 初回外部リンク確認モーダル
 * ============================================================ */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.confirm-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.confirm-modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem 2rem 1.5rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.confirm-modal-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 1.5rem;
}

.confirm-modal-ok {
  display: inline-block;
  padding: 0.6rem 2.5rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.confirm-modal-ok:hover {
  background: var(--accent-hover);
  transform: scale(1.03);
}

.confirm-modal-ok:active {
  transform: scale(0.97);
}

.confirm-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.confirm-modal-cancel {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.confirm-modal-cancel:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.confirm-modal-delete {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.confirm-modal-delete:hover {
  background: #b91c1c;
  transform: scale(1.03);
}

.confirm-modal-delete:active {
  transform: scale(0.97);
}

/* ============================================================
 * 商品カード（内部）
 * ============================================================ */
.product-card-name {
  margin: 1rem 1rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.product-card-name .cond-badge.jan {
  display: inline-flex;
  padding: 0.04rem 0.35rem;
  font-size: 0.58rem;
  font-weight: 600;
  color: #1a6fb5;
  background: #e6f2fa;
  border: 1px solid #7ab8e0;
  border-radius: 4px;
  line-height: 1.5;
  flex-shrink: 0;
}

.product-card-name .cond-badge.kids {
  display: inline-flex;
  padding: 0.04rem 0.35rem;
  font-size: 0.58rem;
  font-weight: 700;
  color: #d4537a;
  background: #fce4ec;
  border: 1px solid #f48fb1;
  border-radius: 4px;
  line-height: 1.5;
  flex-shrink: 0;
}

.product-card-name .format-badge {
  display: inline-flex;
  padding: 0.04rem 0.35rem;
  font-size: 0.58rem;
  font-weight: 700;
  border-radius: 4px;
  line-height: 1.5;
  flex-shrink: 0;
}
.product-card-name .format-badge.dl {
  color: #1a6fb5;
  background: #e3f0fa;
  border: 1px solid #9ac4e8;
}
.product-card-name .format-badge.pkg {
  color: #2d7a3a;
  background: #e6f4e8;
  border: 1px solid #a3d8ad;
}

/* 値下がりバッジ（商品画像の左上に重ねる） */
.drop-badge {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: #c0392b;
  border-radius: 4px;
  line-height: 1.5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* 在庫切れバッジ（商品画像の左上、値下がりバッジの下に重ねる） */
.outofstock-badge {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: #7f8c8d;
  border-radius: 4px;
  line-height: 1.5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* 値下がりバッジがある場合、在庫切れバッジはその下に */
.drop-badge + .outofstock-badge {
  top: 1.6rem;
}

/* ホームバッジ（今値下げされた商品 / 最近よく検索される商品）がある場合、
   値下がりバッジはその下に */
.home-drop-badge ~ .drop-badge,
.home-search-cache-badge ~ .drop-badge {
  top: 1.6rem;
}

/* ホームバッジ + 値下がりバッジがある場合、在庫切れバッジはさらに下に */
.home-drop-badge ~ .drop-badge + .outofstock-badge,
.home-search-cache-badge ~ .drop-badge + .outofstock-badge {
  top: 2.85rem;
}

/* ホームバッジがあり値下がりバッジがない場合、在庫切れバッジはホームバッジの下に */
.home-drop-badge ~ .outofstock-badge,
.home-search-cache-badge ~ .outofstock-badge {
  top: 1.6rem;
}

/* ホームバッジ共通（商品画像の左上に表示） */
.home-drop-badge,
.home-search-cache-badge {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  border-radius: 4px;
  line-height: 1.5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  max-width: calc(100% - 0.7rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 今値下げされた商品バッジ */
.home-drop-badge {
  background: linear-gradient(135deg, #e67e22, #d35400);
}

/* 最近よく検索される商品バッジ */
.home-search-cache-badge {
  background: linear-gradient(135deg, #4a90d9, #2e6db4);
}

/* 在庫切れカード全体をやや薄く */
.product-card.is-out-of-stock {
  opacity: 0.65;
}

/* ============================================================
 * 値下がり / 在庫復活 通知カード：ホログラム風キラキラ演出
 * ============================================================ */
@keyframes hologram-shimmer {
  0%   { transform: translate(-50%, -50%) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.18; }
  30%  { opacity: 0.35; }
  50%  { opacity: 0.18; }
  70%  { opacity: 0; }
  100% { transform: translate(50%, 50%) rotate(0deg);     opacity: 0; }
}

@keyframes hologram-rainbow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes price-glow-pulse {
  0%, 100% { text-shadow: 0 0 4px rgba(180,200,220,0.4), 0 0 8px rgba(160,190,215,0.2); }
  50%      { text-shadow: 0 0 8px rgba(190,215,240,0.7), 0 0 16px rgba(170,200,230,0.4), 0 0 24px rgba(160,195,225,0.2); }
}

@keyframes link-glow-pulse {
  0%, 100% { border-color: rgba(180,200,220,0.2); box-shadow: 0 0 0px rgba(180,200,220,0); }
  50%      { border-color: rgba(190,215,240,0.5); box-shadow: 0 0 6px rgba(170,200,230,0.25); }
}

.product-card.has-update {
  position: relative;
  overflow: hidden;
}

/* キラキラ光の帯 */
.product-card.has-update::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 35%,
    rgba(255,255,255,0.15) 40%,
    rgba(210,225,245,0.3) 45%,
    rgba(255,255,255,0.2) 50%,
    rgba(190,210,235,0.1) 55%,
    transparent 60%,
    transparent 100%
  );
  background-size: 400% 400%;
  animation: hologram-rainbow 3s ease-in-out infinite;
}

/* キラキラ光の粒（スパークル） */
.product-card.has-update::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -50%;
  width: 60%;
  height: 200%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.6) 40%,
    rgba(220,235,250,0.8) 45%,
    rgba(255,255,255,0.9) 48%,
    rgba(200,220,245,0.3) 50%,
    transparent 55%
  );
  transform: skewX(-20deg);
  animation: hologram-shimmer 2.2s ease-in-out infinite;
}

/* 値下がり価格をキラキラ光らせる */
.has-update .card-listing-price {
  animation: price-glow-pulse 2s ease-in-out infinite;
  color: #3a7d9c;
  font-weight: 700;
}

/* リンクもほのかに光らせる */
.has-update .card-listing-link {
  border-radius: 6px;
  transition: border-color 0.3s, box-shadow 0.3s;
  animation: link-glow-pulse 2s ease-in-out infinite;
}

/* カード内の要素がシャインより前に来るように */
.product-card.has-update > * {
  position: relative;
  z-index: 1;
}

/* 在庫切れ + 更新通知の場合は opacity を戻す（シャインが見えるように） */
.product-card.has-update.is-out-of-stock {
  opacity: 0.85;
}

@keyframes badge-glow-pulse {
  0%, 100% { box-shadow: 0 1px 4px rgba(0,0,0,0.2), 0 0 8px rgba(192,57,43,0.3); }
  50%      { box-shadow: 0 1px 4px rgba(0,0,0,0.2), 0 0 16px rgba(220,80,50,0.6); }
}

/* has-updateカードのドロップバッジをパルス */
.has-update .drop-badge {
  animation: badge-glow-pulse 1.5s ease-in-out infinite;
}

/* 値下げ幅表示 */
.card-price-drop-amount {
  margin: 0.3rem 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  flex-wrap: wrap;
}
.price-drop-amount-label {
  color: var(--muted);
  font-size: 0.7rem;
}
.price-drop-amount-value {
  color: #c9404a;
  font-weight: 700;
  font-size: 0.85rem;
}
.price-drop-amount-old {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

/* ショップリンク一覧 */
.card-listing-list {
  list-style: none;
  margin: 0 1rem;
  padding: 0;
  border-top: 1px solid var(--line);
}

.card-listing-item {
  margin: 0;
  padding: 0;
}

.card-listing-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.38rem 0.05rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.74rem;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.card-listing-link:hover {
  color: var(--ink);
  padding-left: 0.3rem;
}

.card-listing-shop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.amazon-cache-note {
  font-size: 0.65rem;
  color: var(--dim);
  font-weight: 400;
  cursor: help;
  vertical-align: super;
}

.card-listing-price {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* 価格と獲得ポイント数を縦に並べるラッパー（右寄せ） */
.card-listing-price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.08rem;
}

/* 価格の下に表示する獲得ポイント数（例: +550pt） */
.card-listing-points {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ポイント還元率バッジ — 商品詳細ページ用 */
.listing-point-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  /* tier1 (1~2% / 1~2倍) — 控えめ */
  background: rgba(212,132,90,0.12);
  color: var(--accent);
}

.listing-point-badge.tier2 {
  /* 3~4% / 3~4倍 — やや目立つ */
  background: rgba(212,132,90,0.22);
  color: #b87333;
}

.listing-point-badge.tier3 {
  /* 5%～ / 5倍～ — かなり目立つ */
  background: #fdf2f2;
  color: #c0392b;
}

/* 送料無料バッジ — カード用 */
.card-listing-postage-badge {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
  background: rgba(46, 139, 87, 0.12);
  color: #2e8b57;
  font-size: 0.58rem;
  font-weight: 700;
  vertical-align: middle;
}

/* 送料無料バッジ — 商品詳細ページ用 */
.listing-postage-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(46, 139, 87, 0.12);
  color: #2e8b57;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 0.4rem;
  white-space: nowrap;
}

.favorite-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.6rem 1rem 0;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  align-self: flex-start;
}

.favorite-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.favorite-button.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.favorite-button:disabled {
  opacity: 0.5;
  cursor: default;
  border-color: var(--dim);
  color: var(--dim);
  background: transparent;
}

.favorite-button:disabled:hover {
  border-color: var(--dim);
  color: var(--dim);
  background: transparent;
}

.card-listing-link.rakuten:hover .card-listing-price {
  color: var(--rakuten);
}

.card-listing-link.yahoo:hover .card-listing-price {
  color: var(--yahoo);
}

.card-listing-link.amazon:hover .card-listing-price {
  color: var(--amazon);
}

/* ============================================================
 * 目標価格入力オーバーレイ
 * PC: 中央モーダル（目立ちやすい）
 * モバイル: 画面下部固定（親指で操作しやすい）
 * ============================================================ */
#target-price-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

#target-price-overlay:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

#target-price-overlay .target-price-input {
  max-width: 520px;
  width: calc(100% - 2rem);
  margin: 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  animation: targetPriceModalIn 0.2s ease;
}

/* モバイル: キーボードと被らないように上部寄せ */
@media (max-width: 560px) {
  #target-price-overlay {
    align-items: flex-start;
    padding-top: 10vh;
  }
}

@keyframes targetPriceModalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
 * 目標価格入力（通知ボタン押下時）
 * ============================================================ */
.target-price-input {
  margin: 0;
  padding: 1rem 1.1rem;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.88rem;
  animation: targetPriceSlideIn 0.2s ease;
  line-height: 1.5;
}

@keyframes targetPriceSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.target-price-header {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.target-price-hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.target-price-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.target-price-field {
  width: 120px;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  text-align: right;
}

.target-price-field:focus {
  outline: none;
  border-color: var(--accent);
}

.target-price-unit {
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.88rem;
}

.target-price-actions {
  display: flex;
  gap: 0.6rem;
}

.target-price-set-btn {
  padding: 0.45rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.target-price-set-btn:hover {
  opacity: 0.85;
}

.target-price-skip-btn {
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.target-price-skip-btn:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

/* 値引き率クイックボタン */
.target-price-percents {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.target-price-pct-btn {
  flex: 1;
  padding: 0.35rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.target-price-pct-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.target-price-pct-btn:active {
  transform: scale(0.96);
}

.target-price-pct-btn .pct-sub {
  display: block;
  font-weight: 400;
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* ============================================================
 * 通知パネル内 目標価格バー
 * ============================================================ */
.target-price-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.3rem 1rem 0.5rem;
  padding: 0.3rem 0.5rem;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.65rem;
}

.target-price-bar.has-update {
  background: #f0f9eb;
  border-color: #c8e6c9;
}

.target-price-label {
  color: var(--muted);
}

.target-price-value {
  font-weight: 600;
  color: var(--ink);
}

.target-price-empty {
  color: var(--dim);
  font-style: italic;
}

.target-price-met {
  color: #4caf50;
  font-weight: 700;
  font-size: 0.6rem;
  background: #e8f5e9;
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
}

.target-price-edit-btn {
  margin-left: auto;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.6rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.target-price-edit-btn:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.target-price-edit-field {
  width: 80px;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 0.68rem;
  color: var(--ink);
  background: #fff;
  text-align: right;
}

.target-price-edit-field:focus {
  outline: none;
  border-color: var(--accent);
}

.target-price-save-btn,
.target-price-cancel-btn {
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 0.6rem;
  cursor: pointer;
  transition: background 0.2s;
}

.target-price-save-btn {
  color: var(--accent);
  border-color: var(--accent);
}

.target-price-save-btn:hover {
  background: var(--bg-hover);
}

.target-price-cancel-btn {
  color: var(--muted);
}

.target-price-cancel-btn:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

/* ============================================================
 * フッター
 * ============================================================ */
.footer {
  margin-top: 4rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--line);
  background: #f3f0eb;
  color: var(--ink);
  font-size: 0.72rem;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-tagline {
  margin: 0;
  color: var(--dim);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

/* ============================================================
 * 検索窓下部 免責文
 * ============================================================ */
.search-disclaimer {
  margin: 0.5rem 1rem;
  font-size: 0.65rem;
  color: var(--dim);
  text-align: center;
  line-height: 1.5;
}

/* ============================================================
 * カード内データ取得日時
 * ============================================================ */
.card-fetched-at {
  margin: 0.15rem 1rem 0.3rem;
  font-size: 0.6rem;
  color: var(--dim);
  text-align: right;
  opacity: 0.6;
}

/* ============================================================
 * 検索履歴ドロップダウン
 * ============================================================ */
.search-history {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  animation: fade-up 0.15s ease both;
  pointer-events: auto;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.history-item:hover {
  background: var(--bg);
  color: var(--ink);
}

.history-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.history-remove {
  flex-shrink: 0;
  margin-left: 0.5rem;
  padding: 0 0.25rem;
  font-size: 1rem;
  line-height: 1;
  color: var(--dim);
  transition: color 0.12s ease;
}

.history-remove:hover {
  color: var(--ink);
}

.history-clear {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: none;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}

.history-clear:hover {
  color: var(--ink);
  background: var(--bg);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 検索サジェスト（オートコンプリート） */
.search-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 9998;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  animation: fade-up 0.12s ease both;
  pointer-events: auto;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.suggest-item:hover,
.suggest-item.active {
  background: var(--accent-light);
  color: var(--accent);
}

.suggest-icon {
  flex-shrink: 0;
  font-size: 0.75rem;
  opacity: 0.5;
}

@keyframes card-resort {
  from {
    opacity: 0.55;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 1.25rem, 1080px);
    padding-top: 1.5rem;
  }

  .hero-top {
    padding: 0 3.25rem;
  }

  .hero {
    padding-bottom: 0.8rem;
  }

  .search-button {
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 0.75rem;
  }

  .product-card-name {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }

  .card-listing-list {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }

  .favorite-button {
    margin-left: 0.75rem;
  }

  .result-section {
    margin-bottom: 1.5rem;
  }

  .result-section-header {
    margin-bottom: 0.75rem;
  }

  .result-section-header h2 {
    font-size: 1rem;
  }

  .result-section-header p {
    font-size: 0.73rem;
  }

  /* モバイル: 目標価格 UI（オーバーレイ表示のため十分なサイズに） */
  .target-price-input {
    margin: 0;
    padding: 1rem 1rem;
    font-size: 0.85rem;
  }

  .target-price-header {
    font-size: 0.95rem;
  }

  .target-price-hint {
    font-size: 0.78rem;
  }

  .target-price-row {
    flex-wrap: nowrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
  }

  .target-price-field {
    width: 90px;
    padding: 0.45rem 0.5rem;
    font-size: 0.95rem;
  }

  .target-price-unit {
    font-size: 0.82rem;
  }

  .target-price-actions {
    gap: 0.5rem;
  }

  .target-price-set-btn,
  .target-price-skip-btn {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
  }

  .target-price-pct-btn {
    font-size: 0.72rem;
    padding: 0.4rem 0.15rem;
  }

  .target-price-pct-btn .pct-sub {
    font-size: 0.58rem;
  }

  /* モバイル: カード内 listing 行をよりコンパクトに */
  .card-listing-link {
    font-size: 0.7rem;
    padding: 0.32rem 0.05rem;
  }

  .card-listing-postage-badge {
    font-size: 0.52rem;
    padding: 0.06rem 0.28rem;
  }

  /* モバイル: 送料無料テキストをトラックアイコンに差し替え */
  .postage-label { display: none; }
  .card-listing-postage-badge::before {
    content: "\01F69A";
    font-size: 0.65rem;
    line-height: 1;
  }
  .listing-postage-badge::before {
    content: "\01F69A";
    font-size: 0.75rem;
    line-height: 1;
  }
  .listing-postage-badge .postage-label { display: none; }

  .card-listing-shop {
    gap: 0.2rem;
  }

  /* ハンバーガーメニュー: モバイル */
  .notif-actions {
    display: inline-flex !important;
  }
}

/* ===== 商品詳細ページ ===== */
.item-detail-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.item-back-link {
  display: inline-block;
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
  margin-bottom: 1rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.item-back-link:hover {
  background: var(--bg);
  text-decoration: underline;
}

.item-detail-section .product-grid {
  grid-template-columns: 1fr;
}

.item-detail-card {
  cursor: default !important;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--bg-card);
}

.item-detail-card .card-listing-price {
  font-size: 1.3rem;
}

.item-detail-card .card-listing-points {
  font-size: 0.85rem;
}

/* 商品詳細: おすすめセクション */
.item-recommendations {
  margin-top: 2rem;
}

.rec-title {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
  text-align: center;
  letter-spacing: 0.03em;
}

.rec-grid {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}

.rec-card {
  flex: 0 0 auto;
  width: 140px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem;
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s;
}

.rec-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rec-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #faf8f5;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.rec-card-name {
  font-size: 0.72rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.rec-card-price {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
}

.item-loading {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  font-size: 0.95rem;
}

/* カードのホバーエフェクト（クリック可能なカード） */
.product-card[data-product-key] {
  transition: box-shadow 0.2s, transform 0.15s;
}

.product-card[data-product-key]:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* ============================================================
 * 人気キーワード
 * ============================================================ */
.explore-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 0 0.25rem;
  flex-wrap: wrap;
  animation: fade-up 0.6s ease 0.35s both;
}

/* ===== 価格推移グラフ ===== */
.price-chart-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.price-chart-title {
  font-family: var(--font-jp);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.75rem 0;
}

.price-chart {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  aspect-ratio: 640 / 240;
}

/* ============================================================
 * モバイル版ボトムナビゲーション
 * ============================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-card);
  border-top: 1px solid var(--line);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: none;
  position: relative;
  color: var(--muted);
  font: inherit;
  font-size: 0.6rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item.active {
  color: var(--accent);
}

.mobile-nav-icon {
  display: block;
}

.mobile-nav-label {
  display: block;
  font-size: 0.6rem;
  line-height: 1;
}

/* モバイルナビのバッジ */
.mobile-nav-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.08rem 0.32rem;
  min-width: 0.8rem;
  text-align: center;
  line-height: 1.3;
}

@media (max-width: 560px) {
  .mobile-nav {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
  }

  /* ヘッダーの 🔔 バッジはモバイルでは非表示（ボトムナビに表示） */
  #my-alerts-link {
    display: none !important;
  }

  /* ボトムナビ分の余白 */
  body {
    padding-bottom: 64px;
  }

  /* モバイルタブ切り替え: 各セクションの表示制御 */
  body[data-mobile-tab="home"] .mobile-home-show,
  body[data-mobile-tab="fav"] .mobile-fav-show,
  body[data-mobile-tab="history"] .mobile-history-show {
    display: initial;
  }

  body[data-mobile-tab="home"] .mobile-home-hide,
  body[data-mobile-tab="fav"] .mobile-fav-hide,
  body[data-mobile-tab="history"] .mobile-history-hide {
    display: none !important;
  }

  /* ページタブ（ホーム/履歴/My通知）はボトムナビで代替 */
  .page-tabs {
    display: none !important;
  }
  .page-carousel {
    display: block !important;
    overflow: visible !important;
  }
  /* hidden 属性の影響を無効化。検索タブでは page-carousel 非表示 */
  .page-carousel[hidden] {
    display: block !important;
  }
  /* パネル: display は常に block。非表示パネルを height:0+overflow:hidden で
     潰すことで、レイアウト計算は維持しつつ視覚的に隠す。
     display:none は子のレイアウト計算を完全スキップするため、
     動的タブ切替時に描画が反映されない問題があった */
  #panel-home,
  #panel-history,
  #panel-notif {
    display: block !important;
    overflow: hidden;
  }
  /* ホームタブ（デフォルト）: ホーム表示 */
  #panel-home {
    height: auto;
  }
  #panel-history {
    height: 0;
  }
  #panel-notif {
    height: 0;
  }
  /* 履歴タブ: 履歴表示 */
  body[data-mobile-tab="history"] #panel-home {
    height: 0;
  }
  body[data-mobile-tab="history"] #panel-history {
    height: auto;
  }
  body[data-mobile-tab="history"] #panel-notif {
    height: 0;
  }
  /* 通知タブ: 通知表示 */
  body[data-mobile-tab="fav"] #panel-home {
    height: 0;
  }
  body[data-mobile-tab="fav"] #panel-history {
    height: 0;
  }
  body[data-mobile-tab="fav"] #panel-notif {
    height: auto;
  }
  /* 検索タブ: 全パネル非表示、ページカルーセル非表示 */
  body[data-mobile-tab="search"] #panel-home,
  body[data-mobile-tab="search"] #panel-history,
  body[data-mobile-tab="search"] #panel-notif {
    height: 0;
  }
  body[data-mobile-tab="search"] .page-carousel {
    display: none !important;
  }
  body[data-mobile-tab="search"] .footer {
    display: none;
  }

  body[data-mobile-tab="home"] #panel-home .product-grid,
  body[data-mobile-tab="history"] #panel-history .product-grid,
  body[data-mobile-tab="fav"] #panel-notif .product-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  /* 履歴タブでは「最近見た商品」見出しを表示（ボトムナビの下で内容が分かるように） */
  body[data-mobile-tab="history"] .history-products-heading {
    display: block;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0.5rem 0.75rem 0;
    padding-top: 0.5rem;
  }
  /* #notif-product-grid 自体は block に上書き（セクションの縦積み用） */
  body[data-mobile-tab="fav"] #panel-notif #notif-product-grid {
    display: block !important;
    gap: 0;
    padding: 0;
  }
  /* セクション内の product-grid だけ 2 カラム（padding なしで横幅いっぱい） */
  body[data-mobile-tab="fav"] #panel-notif .notif-section-body .product-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0;
  }
  .notif-alert-matches {
    grid-template-columns: 1fr 1fr;
  }

  /* 検索結果は検索タブのみ表示 */
  body:not([data-mobile-tab="search"]) #search-section {
    display: none !important;
  }
  body[data-mobile-tab="search"] #search-section {
    display: block !important;
  }

  /* 通知バーはお気に入りタブのみ表示 */
  body:not([data-mobile-tab="fav"]) .notif-bar {
    display: none !important;
  }

  /* お気に入りタブ: notif-actions を表示 */
  /* 検索結果は検索タブに固定（上のルールで制御） */

  /* 各タブのヘッダー調整: バナーはホームと同じ大きさに統一 */
  body:not([data-mobile-tab="home"]) .headline {
    display: none;
  }
  body:not([data-mobile-tab="home"]) .hero-note {
    display: none;
  }
  body:not([data-mobile-tab="home"]) .search-panel {
    margin-top: 0.25rem;
  }
}

/* ============================================================
   検索通知（Search Alert）
   ============================================================ */

/* 検索保存ボタン（検索結果ヘッダー内に埋め込み） */
.search-save-inline-btn {
  margin-left: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.search-save-inline-btn:hover {
  opacity: 0.9;
}

/* モーダル */
.alert-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 1rem;
}
.alert-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.alert-modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 1;
}
.alert-modal-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.alert-modal-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.5;
}
.alert-modal-field {
  margin-bottom: 1rem;
}
.alert-modal-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.alert-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.9rem;
  background: #faf8f5;
  box-sizing: border-box;
}
.alert-price-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.alert-yen {
  font-size: 0.9rem;
  color: var(--ink);
}
.alert-price-input {
  flex: 1;
}
.alert-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}
.alert-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  cursor: pointer;
  background: #fff;
}
.alert-btn-save {
  background: #4a90d9;
  color: #fff;
  border-color: #4a90d9;
  font-weight: 500;
}
.alert-btn-cancel {
  color: var(--muted);
}

/* マイ通知リンク */
.my-alerts-link {
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(184, 160, 122, 0.15);
  border-radius: 999px;
  background: rgba(184, 160, 122, 0.04);
  transition: background 0.15s;
}
.my-alerts-link:hover {
  background: rgba(184, 160, 122, 0.1);
}
.alerts-badge {
  background: #e74c3c;
  color: #fff;
  font-size: 0.65rem;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  min-width: 1rem;
  text-align: center;
  line-height: 1.3;
}

/* マイ通知パネル */
.my-alerts-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 900;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.my-alerts-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
}
.my-alerts-panel-title {
  font-size: 0.95rem;
  font-weight: 600;
}
.my-alerts-panel-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  line-height: 1;
}
.my-alerts-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}
.my-alerts-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 2rem 0;
}

.my-alerts-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.my-alerts-item:last-child {
  border-bottom: none;
}
.my-alerts-item-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  align-items: baseline;
  margin-bottom: 0.4rem;
}
.my-alerts-item-keyword {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
.my-alerts-item-price {
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(160, 192, 120, 0.12);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}
.my-alerts-item-date {
  font-size: 0.7rem;
  color: var(--muted);
}
.my-alerts-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.my-alerts-new-badge {
  background: #e74c3c;
  color: #fff;
  font-size: 0.7rem;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}
.my-alerts-delete-btn {
  font-size: 0.75rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  margin-left: auto;
}
.my-alerts-delete-btn:hover {
  background: rgba(231, 76, 60, 0.08);
  border-color: #e74c3c;
  color: #e74c3c;
}

/* ============================================================
 * 通知タブ：検索条件セクション（タブ内表示用）
 * ============================================================ */
.notif-alert-section,
.notif-fav-section {
  margin-bottom: 1.5rem;
  min-width: 0;
}

/* --- タブバー（モバイル専用） --- */
.notif-tab-bar {
  display: none;
}

.notif-tab-btn {
  flex: 1;
  padding: 0.45rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  border: none;
  border-bottom: 2px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font: inherit;
  font-weight: 700;
  font-family: var(--font-round);
}

.notif-tab-btn.active {
  color: var(--ink);
  border-bottom-color: #c9404a;
}

/* --- セクションヘッダー（デスクトップ用） --- */
.notif-section-header {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--line);
  text-align: center;
}

/* 折り畳みボディ */
.notif-section-body {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s;
  max-height: 6000px;
  opacity: 1;
}

.notif-section-collapsed .notif-section-body {
  max-height: 0;
  opacity: 0;
}

.notif-alert-section,
.notif-fav-section {
  text-align: left;
}

#panel-notif .product-card {
  text-align: left;
}

/* ============================================================
 * デスクトップ: 両セクション常時表示（タブバー非表示）
 * ============================================================ */
@media (min-width: 561px) {
  .notif-tab-bar {
    display: none !important;
  }
  #notif-product-grid {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
  }
  #notif-product-grid > .notif-alert-section,
  #notif-product-grid > .notif-fav-section {
    flex: 1 1 50%;
  }
  /* モバイルのタブ順（🔔商品通知 → 📋検索条件）に合わせて左右を入れ替える */
  #notif-product-grid > .notif-fav-section {
    order: 1;
  }
  #notif-product-grid > .notif-alert-section {
    order: 2;
  }
  .notif-section-collapsed .notif-section-body {
    max-height: none !important;
    opacity: 1 !important;
  }
}

/* ============================================================
 * モバイル: タブバー表示 / セクションヘッダー非表示 / 片方のみ表示
 * ============================================================ */
@media (max-width: 560px) {
  .notif-tab-bar {
    display: flex;
    margin-bottom: 0.75rem;
  }
  /* セクションヘッダーはタブバーが代替するので非表示 */
  .notif-section-header {
    display: none;
  }
  .notif-alert-section,
  .notif-fav-section {
    margin-bottom: 0;
  }
  .notif-section-open {
    width: 100%;
  }
  /* モバイル: 折りたたみ中（商品通知タブ表示時）は注意書きを隠す。
     「検索条件より商品通知のほうが…」は検索条件タブでのみ表示する。 */
  .notif-section-collapsed .notif-alert-notice {
    display: none;
  }
  .notif-alert-matches {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }
}

/* --- alert カード: 2行レイアウト --- */
.notif-alert-card {
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.4rem;
  background: #f9f7f3;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* 検索条件の注意書き */
.notif-alert-notice {
  font-size: 0.72rem;
  color: #888;
  padding: 0.4rem 0.5rem 0.6rem;
  line-height: 1.5;
  text-align: center;
  border-bottom: 1px dashed var(--hairline);
  margin-bottom: 0.3rem;
}

.notif-alert-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.notif-alert-row + .notif-alert-row {
  margin-top: 0.35rem;
}

.notif-alert-keyword {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-alert-price {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

.notif-alert-new-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: #e44d26;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.notif-alert-delete {
  flex-shrink: 0;
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  margin-left: auto;
}

.notif-alert-delete:hover {
  color: #c9404a;
  border-color: #fecaca;
}

.notif-alert-clear {
  flex-shrink: 0;
  font-size: 0.65rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  margin-left: auto;
}

.notif-alert-clear:hover {
  background: var(--accent-light);
  color: var(--accent-hover);
}

/* 通知タブ：条件にヒットした商品一覧 */
.notif-alert-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.4rem;
  margin: -0.2rem 0 0.6rem;
}

.notif-alert-match {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-card);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s;
  cursor: pointer;
}

.notif-alert-match:hover {
  background: var(--bg-card-hover);
}

.notif-alert-match img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
  background: #f0ece7;
}

.notif-alert-match-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.notif-alert-match-name {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-alert-match-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e44d26;
}
