/* ===== リセット & 基本 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* くすみニュアンスカラー */
  --pink-50: #fef7f9;
  --pink-100: #fdeef3;
  --pink-200: #f9d0de;
  --pink-300: #f2a3bf;
  --pink-400: #e8799e;
  --pink-500: #d4628a;
  --pink-600: #b84d73;
  --pink-700: #9a3d5f;
  --pink-800: #7e324d;
  --pink-900: #6b2a42;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --green-500: #22c55e;
  --green-100: #dcfce7;
  --orange-500: #f97316;
  --orange-100: #ffedd5;
  --red-500: #ef4444;
  --yellow-400: #facc15;
  --rose-gold: #c08b7e;
  --champagne: #f7e7ce;
  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.3);
  --glass-blur: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 24px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --text-primary: var(--gray-800);
  --text-secondary: var(--gray-500);
}

html, body {
  height: 100%;
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--gray-800);
  background: var(--pink-50);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.hidden { display: none !important; }

/* ===== ヘッダー（ガラスモーフィズム） ===== */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(52px + var(--safe-top));
  padding: var(--safe-top) 16px 0 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  color: var(--gray-800);
}

@supports not (backdrop-filter: blur(1px)) {
  #app-header {
    background: rgba(255,255,255,0.95);
  }
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-btn {
  background: none;
  border: none;
  color: var(--gray-700);
  font-size: 20px;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  line-height: 1;
}

.header-btn:active {
  background: rgba(0,0,0,0.05);
}

#header-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--pink-700);
}

/* ===== メイン ===== */
#app-main {
  padding-top: calc(52px + var(--safe-top));
  padding-bottom: calc(68px + var(--safe-bottom));
  min-height: 100vh;
}

.view {
  display: none;
  animation: view-enter 0.3s ease-out;
}
.view.active { display: block; }

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ボトムナビゲーション ===== */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  height: calc(60px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--glass-border);
}

@supports not (backdrop-filter: blur(1px)) {
  #bottom-nav {
    background: rgba(255,255,255,0.95);
  }
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  padding: 6px 0;
}

.nav-item:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-item.active {
  color: var(--pink-600);
}

.nav-icon {
  width: 22px;
  height: 22px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ===== カメラエリア ===== */
#camera-area {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 60vh;
  background: var(--gray-900);
  overflow: hidden;
}

#camera-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  text-align: center;
  padding: 20px;
}

.placeholder-icon {
  margin-bottom: 12px;
  opacity: 0.7;
}

/* バーコードガイド（コーナーマーカー） */
#barcode-guide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.guide-frame {
  position: relative;
  width: 260px;
  height: 120px;
  border: none;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.4);
}

/* 4隅コーナーマーカー */
.guide-frame::before,
.guide-frame::after,
.guide-frame .corner-tr,
.guide-frame .corner-bl {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--pink-300);
  border-style: solid;
  border-width: 0;
}

/* 左上 */
.guide-frame::before {
  top: 0; left: 0;
  border-top-width: 3px;
  border-left-width: 3px;
  border-top-left-radius: 6px;
  animation: corner-pulse 2s ease-in-out infinite;
}

/* 右下 */
.guide-frame::after {
  bottom: 0; right: 0;
  border-bottom-width: 3px;
  border-right-width: 3px;
  border-bottom-right-radius: 6px;
  animation: corner-pulse 2s ease-in-out infinite 0.5s;
}

/* 右上 */
.guide-frame .corner-tr {
  top: 0; right: 0;
  border-top-width: 3px;
  border-right-width: 3px;
  border-top-right-radius: 6px;
  animation: corner-pulse 2s ease-in-out infinite 0.25s;
}

/* 左下 */
.guide-frame .corner-bl {
  bottom: 0; left: 0;
  border-bottom-width: 3px;
  border-left-width: 3px;
  border-bottom-left-radius: 6px;
  animation: corner-pulse 2s ease-in-out infinite 0.75s;
}

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

.guide-text {
  color: #fff;
  font-size: 13px;
  margin-top: 12px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.guide-text-sub {
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  margin-top: 4px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* スキャンアニメーション */
#scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scan-line {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--pink-400);
  box-shadow: 0 0 8px var(--pink-400);
  animation: scan-move 2s ease-in-out infinite;
}

@keyframes scan-move {
  0%, 100% { top: 30%; }
  50% { top: 70%; }
}

/* スキャン成功演出 */
#scan-success {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
}

.scan-success-ring {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--green-500);
  animation: ring-expand 0.6s ease-out forwards;
}

@keyframes ring-expand {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

.scan-success-check {
  animation: check-pop 0.4s ease-out 0.15s both;
}

@keyframes check-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== スキャンアクション ===== */
.scan-actions {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scan-sub-actions {
  display: flex;
  gap: 8px;
}

.scan-sub-actions .btn-secondary {
  flex: 1;
}

/* ===== ボタン ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(184,77,115,0.25);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-large {
  padding: 14px 24px;
  font-size: 16px;
  width: 100%;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: #fff;
  color: var(--pink-600);
  border: 1px solid var(--pink-200);
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:active {
  background: var(--pink-50);
  border-color: var(--pink-300);
}

/* ===== カード ===== */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
}

.card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* アクセントライン付きカード */
.card-accent {
  position: relative;
  overflow: hidden;
  padding-top: 0;
}

.card-accent::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--rose-gold), var(--pink-400));
}

/* AI要約取得中のカードローディング状態 */
.card-loading {
  position: relative;
}
.ai-loading-msg {
  font-size: 13px;
  padding: 8px 0;
  color: var(--gray-400);
  font-style: italic;
}

/* AI要約プログレスバー */
.ai-progress {
  margin: 12px 0 8px;
}
.ai-progress-bar-bg {
  height: 6px;
  background: #f3f4f6;
  border-radius: 3px;
  overflow: hidden;
}
.ai-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  color: #9ca3af;
}
.ai-progress-step {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ai-progress-step .spinner-dot {
  width: 6px;
  height: 6px;
  background: #ec4899;
  border-radius: 50%;
  animation: pulse-dot 1s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}
.ai-progress-done .ai-progress-bar {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

/* 結果カードのstaggerアニメーション */
.result-card {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.result-card.card-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 商品情報（ギャラリーカルーセル） ===== */
.product-hero {
  width: calc(100% + 32px);
  margin-left: -16px;
  background: linear-gradient(135deg, var(--pink-50), var(--gray-50));
  overflow: hidden;
  position: relative;
}

.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar { display: none; }

.gallery-track img {
  flex-shrink: 0;
  width: 100%;
  height: 220px;
  object-fit: contain;
  scroll-snap-align: center;
  cursor: zoom-in;
  padding: 12px;
}

/* 画像なし時のプレースホルダー */
.gallery-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  font-size: 14px;
}

/* ドットインジケータ */
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
}

.gallery-dots.hidden { display: none; }

.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray-300);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.gallery-dot.active {
  background: var(--pink-500);
  transform: scale(1.3);
}

/* ===== ライトボックス ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lightbox-in 0.2s ease-out;
}

@keyframes lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox.hidden { display: none !important; }

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 310;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lightbox-close:active { background: rgba(255,255,255,0.3); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 310;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 36px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lightbox-nav:active { background: rgba(255,255,255,0.3); }

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-nav.hidden { display: none; }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 600;
}

.product-meta {
  padding: 12px 0 4px;
}

.product-meta h2 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 2px;
}

.text-muted {
  color: var(--gray-500);
  font-size: 13px;
}

/* 評価 */
.rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.rating .stars {
  color: var(--yellow-400);
  font-size: 14px;
  letter-spacing: 1px;
}

.rating .score {
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-700);
}

.rating .count {
  font-size: 12px;
  color: var(--gray-400);
}

/* ===== 商品概要 ===== */
#product-overview #overview-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray-700);
  margin-bottom: 10px;
}

.overview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.overview-tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 999px;
  font-weight: 500;
  background: var(--pink-100);
  color: var(--pink-700);
}

.overview-tag.category {
  background: var(--pink-200);
  color: var(--pink-800);
  font-weight: 600;
}

/* ===== AI要約 ===== */
#summary-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray-700);
  margin-bottom: 10px;
}

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-tag {
  display: inline-block;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--pink-100);
  color: var(--pink-700);
  font-weight: 500;
}

.keyword-tag.positive {
  background: var(--green-100);
  color: #166534;
}

.keyword-tag.negative {
  background: var(--orange-100);
  color: #9a3412;
}

/* ===== レビュータブ ===== */
.review-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn.active {
  border-color: var(--pink-400);
  background: var(--pink-50);
  color: var(--pink-700);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.review-item {
  padding: 10px 0 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-600);
  position: relative;
}

/* レビュー左アクセントバー */
.review-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background: var(--gray-200);
}

#reviews-good .review-item::before {
  background: var(--green-500);
}

#reviews-bad .review-item::before {
  background: var(--orange-500);
}

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

.review-source {
  display: inline-block;
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 4px;
  padding: 2px 8px;
  background: var(--gray-100);
  border-radius: 999px;
  font-weight: 600;
}

.review-source.source-rakuten {
  background: #fff0f0;
  color: #bf0000;
}

.review-source.source-x {
  background: #1a1a2e;
  color: #fff;
}

/* AI要約注記 */
.ai-summary-notice {
  font-size: 11px;
  color: var(--gray-400);
  margin-bottom: 8px;
  padding: 4px 10px;
  background: var(--gray-50);
  border-radius: 6px;
  border-left: 3px solid var(--pink-200);
}
.ai-summary-notice:empty {
  display: none;
}

/* 楽天プラットフォームラベル */
.rating-platform {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #bf0000;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 2px;
  vertical-align: middle;
  line-height: 1.6;
}

/* ===== 最安値比較 ===== */
.price-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  border-bottom: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

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

/* 最安値ハイライト */
.price-item.cheapest-item {
  background: var(--champagne);
}

.price-shop {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-shop-name {
  font-size: 14px;
  font-weight: 600;
}

.price-shop-name.cheapest {
  color: var(--pink-600);
}

.price-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: #fff;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

/* 最安値バッジのキラキラ */
.price-badge::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255,255,255,0.4) 50%,
    transparent 70%
  );
  animation: sparkle 2.5s ease-in-out infinite;
}

@keyframes sparkle {
  0% { transform: translateX(-100%) rotate(0deg); }
  100% { transform: translateX(100%) rotate(0deg); }
}

.price-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.price-amount {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-800);
}

.price-amount.cheapest {
  color: var(--red-500);
}

.price-link {
  display: inline-block;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--pink-500);
  border-radius: 999px;
  text-decoration: none;
  transition: opacity 0.1s;
}

.price-link:active {
  opacity: 0.8;
}

.price-link.rakuten { background: #bf0000; }
.price-link.yahoo { background: #ff0033; }
.price-link.amazon { background: #ff9900; color: #000; }

/* Amazonプライムバッジ */
.prime-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #00a8e1;
  background: #f0f9ff;
  padding: 2px 8px;
  border-radius: 999px;
}

/* 送料バッジ */
.postage-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.postage-free {
  background: var(--green-100);
  color: #166534;
}

.postage-paid {
  background: var(--gray-100);
  color: var(--gray-500);
}

.postage-conditional {
  background: #ecfdf5;
  color: #047857;
  border: 1px dashed #047857;
}

.postage-unknown {
  background: #fff7ed;
  color: #9a3412;
}

/* 送料注意書き */
.postage-notice {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--gray-100);
}

.ad-label {
  font-size: 11px;
  color: var(--gray-400);
  text-align: right;
  margin-top: 8px;
}

/* ===== 関連商品 ===== */
.related-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.related-scroll::-webkit-scrollbar { display: none; }

.related-item {
  flex-shrink: 0;
  width: 150px;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.related-item img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
}

.related-item-name {
  font-size: 12px;
  line-height: 1.4;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-item-price {
  font-family: "Cormorant Garamond", serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--red-500);
  margin-top: 2px;
}

/* バッジ（画像左上オーバーレイ） */
.related-badges { position: absolute; top: 4px; left: 4px; display: flex; flex-wrap: wrap; gap: 3px; z-index: 1; }
.related-badge { padding: 2px 6px; font-size: 10px; font-weight: 700; border-radius: 4px; color: #fff; }
.badge-free-ship { background: var(--green-500); }
.badge-asuraku { background: #3b82f6; }
.badge-point { background: var(--orange-500); }

/* 星評価 */
.related-item-rating { display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.related-stars { color: var(--yellow-400); font-size: 11px; }
.related-score { font-size: 11px; font-weight: 600; color: var(--gray-600); }

/* おすすめポイント */
.related-item-highlight { font-size: 11px; font-weight: 700; color: var(--pink-600); background: var(--pink-100); border-radius: 4px; padding: 2px 6px; margin-top: 3px; text-align: center; }

/* ===== 結果アクション ===== */
.result-actions {
  display: flex;
  gap: 8px;
  padding: 16px;
}

.result-actions .btn-secondary { flex: 1; }
.result-actions .btn-primary { flex: 2; }

/* お気に入りボタン（結果画面） */
#btn-fav.favorited {
  background: var(--pink-50);
  border-color: var(--pink-400);
  color: var(--pink-600);
}

/* ===== スケルトンローディング ===== */
.loading-container {
  padding: 16px;
}

.skeleton-container {
  margin-bottom: 16px;
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-product {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.04);
  margin-bottom: 12px;
}

.skeleton-hero {
  height: 180px;
  border-radius: 0;
}

.skeleton-meta {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-text {
  height: 14px;
}

.skeleton-text-sm {
  height: 10px;
}

.skeleton-text-lg {
  height: 18px;
}

.skeleton-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

#loading-message {
  color: var(--gray-500);
  font-size: 13px;
  text-align: center;
  margin-top: 4px;
}

/* ===== ローディングステップ ===== */
.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 20px 8px 8px;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid rgba(0,0,0,0.04);
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  opacity: 0.22;
  transition: opacity 0.5s ease;
  border-bottom: 1px solid var(--gray-100);
}
.loading-step:last-child {
  border-bottom: none;
}

.loading-step.step-active {
  opacity: 1;
}
.loading-step.step-done {
  opacity: 0.55;
}

.step-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  transition: background 0.4s;
}
.loading-step.step-active .step-indicator {
  background: var(--pink-100);
  animation: step-beat 1.4s ease-in-out infinite;
}
.loading-step.step-done .step-indicator {
  background: var(--green-100);
  animation: none;
}

@keyframes step-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.step-text {
  font-size: 13px;
  color: var(--gray-700);
  font-weight: 400;
}
.loading-step.step-active .step-text {
  font-weight: 600;
  color: var(--pink-700);
}

/* ===== エラー ===== */
.error-container {
  padding: 60px 20px;
  text-align: center;
}

#error-message {
  color: var(--red-500);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ===== 履歴 ===== */
.history-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 16px 8px 16px;
}

.history-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--pink-500);
  border-radius: 999px;
}

/* お気に入りフィルタ */
.history-filter {
  display: flex;
  gap: 8px;
  padding: 0 16px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.history-filter::-webkit-scrollbar { display: none; }

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-btn.active {
  border-color: var(--pink-400);
  background: var(--pink-50);
  color: var(--pink-700);
}

#history-search {
  padding: 0 16px 8px;
}

#history-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#history-search input:focus {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 3px rgba(184,77,115,0.1);
}

/* 履歴アイテム（カード化） */
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 16px 8px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  cursor: pointer;
  transition: background 0.1s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.history-item:active {
  background: var(--gray-50);
  transform: scale(0.99);
}

.history-item-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  flex-shrink: 0;
}

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

.history-item-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-brand {
  font-size: 12px;
  color: var(--gray-400);
}

.history-item-rating {
  font-size: 12px;
  color: var(--yellow-400);
}

.history-item-date {
  font-size: 11px;
  color: var(--gray-400);
}

/* 履歴カード メタ行（評価+最安値） */
.history-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-item-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--pink-600);
}

/* 履歴カード タグ */
.history-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.history-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 999px;
  background: var(--pink-100);
  color: var(--pink-700);
  font-weight: 500;
  white-space: nowrap;
}

.history-tag-more {
  background: var(--gray-100);
  color: var(--gray-500);
}

/* タグセレクタ */
.tag-selector-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag-chip {
  display: inline-block;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s;
}

.tag-chip.active {
  border-color: var(--pink-400);
  background: var(--pink-50);
  color: var(--pink-700);
  font-weight: 600;
}

.tag-selector-input {
  display: flex;
  gap: 6px;
}

.tag-selector-input input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  font-size: 13px;
  outline: none;
}

.tag-selector-input input:focus {
  border-color: var(--pink-400);
}

.btn-add-tag {
  padding: 8px 14px;
  border: none;
  background: var(--pink-500);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* 履歴シェブロン */
.history-chevron {
  flex-shrink: 0;
  color: var(--gray-300);
}

/* お気に入りハート */
.history-fav-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--gray-300);
  transition: color 0.15s, transform 0.15s;
}

.history-fav-btn.favorited {
  color: var(--pink-500);
}

.history-fav-btn:active {
  transform: scale(1.2);
}

/* スワイプ削除 */
.history-item-wrapper {
  position: relative;
  overflow: hidden;
}

.swipe-delete-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80px;
  background: var(--red-500);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 16px 8px 0;
}

.history-item.swiping {
  transition: transform 0.15s ease-out;
}

/* 編集ボタン */
.history-edit-btn {
  margin-left: auto;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pink-600);
  background: #fff;
  border: 1px solid var(--pink-200);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}

.history-edit-btn:active {
  background: var(--pink-50);
}

.history-edit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 選択ツールバー */
.edit-toolbar {
  position: fixed;
  bottom: calc(60px + var(--safe-bottom));
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--glass-border);
}

.edit-toolbar .btn-primary {
  padding: 10px 20px;
  font-size: 14px;
}

.edit-toolbar .btn-secondary {
  padding: 10px 16px;
  font-size: 13px;
}

/* 編集モード: チェックボックス表示 */
.edit-mode .history-item {
  padding-left: 44px;
}

.edit-mode .history-item::after {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  background: #fff;
  transition: all 0.15s;
}

.edit-mode .history-item.selected::after {
  background: var(--pink-500);
  border-color: var(--pink-500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}

/* 編集モード: お気に入り・シェブロン非表示 */
.edit-mode .history-fav-btn,
.edit-mode .history-chevron {
  display: none;
}

/* 空状態 */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--gray-500);
}

.empty-state-icon {
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 4px;
}

/* ===== 手動検索 ===== */
.search-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
}

.search-form input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-form input:focus {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 3px rgba(184,77,115,0.1);
}

.search-form .btn-primary {
  white-space: nowrap;
}

/* ===== トースト ===== */
.toast {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 10px 20px;
  background: var(--gray-800);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== 口コミ信頼度バッジ ===== */
.review-trust {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

.review-trust.trust-high {
  background: var(--green-100);
  color: #166534;
}

.review-trust.trust-medium {
  background: #fef9c3;
  color: #854d0e;
}

.review-trust.trust-low {
  background: var(--orange-100);
  color: #9a3412;
}

.review-trust.trust-none {
  background: var(--gray-100);
  color: var(--gray-500);
}

/* ===== 成分情報カード ===== */
.ingredient-section {
  margin-bottom: 10px;
}

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

.ingredient-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.ingredient-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ingredient-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  font-weight: 500;
}

.ingredient-tag.featured {
  background: var(--green-100);
  color: #166534;
}

.ingredient-tag.caution {
  background: var(--orange-100);
  color: #9a3412;
}

.ingredient-tag.all {
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11px;
}

.ingredients-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--gray-500);
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
}

.ingredients-toggle:active {
  background: var(--gray-50);
}

.all-ingredients {
  display: none;
  margin-top: 8px;
}

.all-ingredients.open {
  display: block;
}

/* ===== 肌質・使用感カード ===== */
.skin-section {
  margin-bottom: 10px;
}

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

.skin-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.skin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skin-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  font-weight: 500;
}

.skin-tag.recommended {
  background: var(--pink-100);
  color: var(--pink-700);
}

.skin-tag.caution {
  background: var(--gray-100);
  color: var(--gray-600);
}

.skin-note {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
  line-height: 1.5;
}

.texture-text {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

/* ===== 相性スコア ===== */
#compatibility-card {
  background: linear-gradient(135deg, #fef7f9, #f0fdf4);
  border: 1px solid rgba(34,197,94,0.15);
}

.compat-container {
  display: flex;
  align-items: center;
  gap: 14px;
}

.compat-score-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.compat-score-ring svg {
  transform: rotate(-90deg);
  width: 64px;
  height: 64px;
}

.compat-score-ring .ring-bg {
  fill: none;
  stroke: var(--gray-200);
  stroke-width: 5;
}

.compat-score-ring .ring-fg {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

.compat-score-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 700;
}

.compat-score-high { color: #166534; }
.compat-score-mid { color: #854d0e; }
.compat-score-low { color: #9a3412; }

.compat-details {
  flex: 1;
  min-width: 0;
}

.compat-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.compat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.compat-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  font-weight: 500;
}

.compat-tag.good {
  background: var(--green-100);
  color: #166534;
}

.compat-tag.bad {
  background: var(--orange-100);
  color: #9a3412;
}

.compat-no-profile {
  text-align: center;
  padding: 8px 0;
}

.compat-no-profile p {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.compat-no-profile .btn-setup-profile {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== NG成分アラート ===== */
#ng-alert {
  background: #fef2f2;
  border: 1px solid rgba(239,68,68,0.2);
}

.ng-alert-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ng-alert-icon {
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
}

.ng-alert-text {
  flex: 1;
}

.ng-alert-title {
  font-size: 13px;
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 4px;
}

.ng-alert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ng-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
}

/* NG成分ハイライト（成分タグ内） */
.ingredient-tag.ng-match {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fca5a5;
}

/* ===== 肌タイプ別口コミフィルター ===== */
.skin-type-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.skin-type-filter::-webkit-scrollbar { display: none; }

.stf-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  color: var(--gray-500);
}

.stf-btn.active {
  border-color: var(--pink-400);
  background: var(--pink-50);
  color: var(--pink-700);
}

.stf-btn.my-type {
  border-color: var(--pink-300);
  position: relative;
}

.stf-btn .stf-my-badge {
  font-size: 9px;
  color: var(--pink-500);
  margin-left: 2px;
}

/* ===== プロフィールモーダル ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: modal-bg-in 0.2s ease;
}

.modal-overlay.hidden { display: none !important; }

@keyframes modal-bg-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: modal-slide-up 0.3s ease-out;
}

@keyframes modal-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  border-bottom: 1px solid var(--gray-100);
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--pink-700);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 16px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 14px;
  font-size: 13px;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--gray-600);
  font-weight: 500;
}

.chip:active {
  transform: scale(0.96);
}

.chip.selected {
  border-color: var(--pink-400);
  background: var(--pink-50);
  color: var(--pink-700);
  font-weight: 600;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  padding-bottom: calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--gray-100);
}

.modal-footer .btn-secondary { flex: 1; }
.modal-footer .btn-primary { flex: 2; }

/* プロフィール設定済みアイコン */
#btn-profile.has-profile {
  color: var(--pink-600);
}

/* 通知ベルボタン */
#btn-notify {
  position: relative;
}
#btn-notify.notify-on {
  color: var(--pink-600);
}
#btn-notify.notify-on svg {
  fill: var(--pink-200);
}
.notify-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  border: 1.5px solid var(--bg-primary);
}

/* ===== Xトレンドセクション ===== */
.trending-section {
  margin-top: 24px;
  padding: 0 16px 8px;
}
.trending-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.trending-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 6px;
}
.trending-updated {
  font-size: 11px;
  color: var(--gray-400);
}
.trending-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.trending-filter::-webkit-scrollbar { display: none; }
.trending-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--pink-200);
  background: white;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.trending-pill.active {
  background: var(--pink-500);
  color: white;
  border-color: var(--pink-500);
}
.trending-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.trending-scroll::-webkit-scrollbar { display: none; }
.trending-card {
  flex-shrink: 0;
  width: 200px;
  scroll-snap-align: start;
  background: white;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--pink-100);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.trending-card:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-md);
}
.trending-card.viewed {
  opacity: 0.55;
  background: var(--gray-50, #f9fafb);
  border-color: var(--gray-200, #e5e7eb);
}
.trending-card.viewed::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  background: var(--gray-200, #e5e7eb);
  color: var(--gray-500, #6b7280);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.trending-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.trending-buzz {
  font-size: 14px;
  line-height: 1;
}
.trending-category-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--pink-50);
  color: var(--pink-600);
  font-weight: 500;
}
.trending-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.4;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trending-card-brand {
  font-size: 11px;
  color: var(--gray-400);
  margin-bottom: 6px;
}
.trending-card-reason {
  font-size: 11px;
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trending-card-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.trending-card-sentiment {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 500;
}
.trending-card-sentiment.positive {
  background: var(--green-100);
  color: #15803d;
}
.trending-card-sentiment.mixed {
  background: #fef9c3;
  color: #a16207;
}
.trending-card-sentiment.negative {
  background: #fee2e2;
  color: #dc2626;
}
.trending-tag {
  font-size: 10px;
  color: var(--pink-500);
  background: var(--pink-50);
  padding: 2px 6px;
  border-radius: 8px;
}
.trending-empty {
  color: var(--gray-400);
  font-size: 13px;
  padding: 16px 0;
  text-align: center;
  width: 100%;
}

/* ===== YouTube レビュー動画 ===== */
.youtube-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.youtube-scroll::-webkit-scrollbar { height: 4px; }
.youtube-scroll::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }
.youtube-card {
  flex: 0 0 85%;
  min-width: 260px;
  max-width: 340px;
  scroll-snap-align: start;
}
.youtube-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-100);
}
.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.youtube-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  margin-top: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.youtube-channel {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* ===== AI待ち豆知識 ===== */
.ai-tips {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 12px;
  min-height: 36px;
  text-align: center;
  transition: opacity 0.4s;
}

/* ===== レスポンシブ ===== */
@media (min-width: 600px) {
  #app-main {
    max-width: 480px;
    margin: 0 auto;
  }
  #bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
  #camera-area {
    max-height: 50vh;
  }
}

/* === Hero Section (SEO/AISEO) === */
.hero-section {
  text-align: center;
  padding: 20px 16px 12px;
  animation: fadeIn 0.5s ease;
}
.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
.hero-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 12px;
}
.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.hero-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--pink-50, #fef1f5);
  color: var(--pink-600, #db2777);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--pink-100, #fce7f3);
}

/* === FAQ Section === */
.faq-section {
  padding: 16px;
  margin-top: 8px;
}
.faq-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
}
.faq-item {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #f3e8f0);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-item summary {
  padding: 12px 16px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--pink-400);
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  content: '-';
}
.faq-item p {
  padding: 0 16px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}
