/* ============================================
   景品コンシェルジュ - 景品キング風スタイルシート
   ============================================ */

:root {
  /* 景品キング テイスト カラー */
  --color-primary: #dd5834;
  --color-primary-light: #e8734f;
  --color-primary-dark: #c44a2b;
  --color-primary-bg: #fdf5f3;
  --color-accent: #f5a623;
  --color-accent-dark: #e0950a;
  --color-accent-light: #fff8e6;
  --color-accent-text: #3d2800;

  /* ベース */
  --color-bg: #ffffff;
  --color-bg-light: #faf9f7;
  --color-bot-bubble: #ffffff;
  --color-bot-bubble-border: #e5e0db;
  --color-user-bubble: #dd5834;
  --color-user-text: #ffffff;
  --color-bot-text: #333333;
  --color-muted: #888888;
  --color-border: #e0dbd5;
  --color-success: #4caf50;

  /* タイポグラフィ */
  --font-main: "游ゴシック体", "Yu Gothic", YuGothic, "ヒラギノ角ゴ ProN", "Hiragino Kaku Gothic ProN", "メイリオ", Meiryo, sans-serif;
  --font-size-base: 14px;
  --font-size-small: 12px;
  --font-size-large: 16px;
  --font-size-xl: 18px;

  /* レイアウト */
  --chat-max-width: 720px;
  --bubble-radius: 16px;
  --bubble-padding: 12px 16px;
  --btn-radius: 4px;
}

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

html, body {
  height: 100%;
  font-family: var(--font-main);
  font-size: var(--font-size-base);
  background: #f4f2ef;
  color: var(--color-bot-text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ============================================
   Layout
   ============================================ */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: var(--chat-max-width);
  margin: 0 auto;
  background: var(--color-bg);
  box-shadow: 0 0 20px rgba(0,0,0,0.06);
}

/* ============================================
   Header - 景品キング風（#dd5834 背景＋白文字）
   ============================================ */
#header {
  background: var(--color-primary);
  color: #fff;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  border-bottom: 3px solid var(--color-primary-dark);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo-icon {
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

#header h1 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.3;
}

.header-subtitle {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 400;
}

.restart-btn {
  background: #fff;
  color: var(--color-accent-dark);
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--btn-radius);
  cursor: pointer;
  font-family: var(--font-main);
  transition: all 0.2s;
  white-space: nowrap;
}

.restart-btn:hover {
  background: #f0f0f0;
}

/* Progress */
.progress-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 10px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 11px;
  opacity: 0.8;
  white-space: nowrap;
  font-weight: 600;
}

/* ============================================
   Chat Area
   ============================================ */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--color-bg-light);
}

/* ============================================
   Messages
   ============================================ */
.message-bot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 88%;
  align-self: flex-start;
  animation: fadeInUp 0.3s ease;
}

.bot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
  box-shadow: 0 2px 6px rgba(245,166,35,0.35);
}

.message-bot .bubble {
  background: var(--color-bot-bubble);
  color: var(--color-bot-text);
  border: 1px solid var(--color-bot-bubble-border);
  border-radius: 2px var(--bubble-radius) var(--bubble-radius) var(--bubble-radius);
  padding: var(--bubble-padding);
  line-height: 1.7;
  font-size: var(--font-size-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.message-bot .bubble strong {
  color: var(--color-accent);
  font-weight: 700;
}

.message-user {
  display: flex;
  justify-content: flex-end;
  align-self: flex-end;
  max-width: 75%;
  animation: fadeInUp 0.3s ease;
}

.message-user .bubble {
  background: var(--color-user-bubble);
  color: var(--color-user-text);
  border-radius: var(--bubble-radius) var(--bubble-radius) 2px var(--bubble-radius);
  padding: var(--bubble-padding);
  line-height: 1.7;
  font-size: var(--font-size-base);
  font-weight: 600;
}

.message-bot.no-avatar .bot-avatar {
  visibility: hidden;
}

/* Step Badge */
.step-badge {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 2px;
  margin-right: 6px;
  margin-bottom: 4px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

/* ============================================
   Typing Indicator
   ============================================ */
.typing-indicator {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  align-self: flex-start;
}

.typing-indicator .bubble {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: var(--color-bot-bubble);
  border: 1px solid var(--color-bot-bubble-border);
  border-radius: 2px var(--bubble-radius) var(--bubble-radius) var(--bubble-radius);
}

.typing-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
}

/* ============================================
   Option Buttons - 景品キング風（角丸控えめ・フラット）
   ============================================ */
.options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 10px 48px;
  animation: fadeInUp 0.3s ease;
}

.option-btn {
  background: #fff;
  border: 2px solid var(--color-accent);
  color: #8a6d00;
  border-radius: var(--btn-radius);
  padding: 10px 20px;
  font-size: var(--font-size-base);
  font-family: var(--font-main);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.option-btn:hover {
  background: var(--color-accent);
  color: var(--color-accent-text);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(245, 166, 35, 0.3);
}

.option-btn:active {
  transform: translateY(0);
}

.option-btn.selected {
  background: var(--color-accent);
  color: var(--color-accent-text);
  pointer-events: none;
}

.option-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ============================================
   Multi-select Chips
   ============================================ */
.chip-icon {
  margin-right: 4px;
  font-size: 16px;
}

.chip-btn {
  background: #fff;
  border: 2px solid var(--color-border);
  color: var(--color-bot-text);
  border-radius: var(--btn-radius);
  padding: 10px 16px;
  font-size: var(--font-size-base);
  font-family: var(--font-main);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.chip-btn:hover {
  border-color: var(--color-accent);
  color: #8a6d00;
}

.chip-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-text);
  font-weight: 600;
}

.chip-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* Confirm / Skip */
.action-buttons {
  display: flex;
  gap: 10px;
  padding: 6px 0 10px 48px;
}

.confirm-btn {
  background: var(--color-accent);
  color: var(--color-accent-text);
  border: none;
  border-radius: var(--btn-radius);
  padding: 10px 30px;
  font-size: var(--font-size-base);
  font-family: var(--font-main);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.confirm-btn:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(245, 166, 35, 0.3);
}

.skip-btn {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--btn-radius);
  padding: 10px 20px;
  font-size: var(--font-size-base);
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.skip-btn:hover {
  color: var(--color-bot-text);
  border-color: #aaa;
}

/* ============================================
   Custom Input
   ============================================ */
.custom-input-container {
  display: flex;
  gap: 8px;
  padding: 8px 0 8px 48px;
  animation: fadeInUp 0.3s ease;
}

.custom-input {
  flex: 1;
  border: 2px solid var(--color-border);
  border-radius: var(--btn-radius);
  padding: 10px 14px;
  font-size: 16px; /* iOS Safari auto-zoom防止 */
  font-family: var(--font-main);
  outline: none;
  transition: border-color 0.2s;
}

.custom-input:focus {
  border-color: var(--color-accent);
}

.custom-input-send {
  background: var(--color-accent);
  color: var(--color-accent-text);
  border: none;
  border-radius: var(--btn-radius);
  width: 42px;
  height: 42px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.custom-input-send:hover {
  background: var(--color-accent-dark);
}

/* --- Budget Input Wrapper --- */
.budget-input-wrapper {
  padding: 0 0 0 48px;
  animation: fadeInUp 0.3s ease;
}

.budget-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.budget-label {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-bot-text);
  flex-shrink: 0;
}

.budget-prefix {
  color: var(--color-accent-dark);
}

.budget-amount {
  width: 200px;
  min-width: 140px;
  flex: 0 1 200px;
  text-align: right;
  font-weight: 600;
  font-size: 16px; /* iOS Safari auto-zoom防止: 16px未満だとフォーカス時にズームされる */
}

.input-error {
  font-size: var(--font-size-small);
  color: #d32f2f;
  padding: 4px 0 0 2px;
  font-weight: 600;
}

@media (max-width: 480px) {
  .budget-input-wrapper {
    padding-left: 0;
  }
  .budget-amount {
    width: 160px;
    flex: 0 1 160px;
  }
}

/* ============================================
   Answer Summary Bar（回答サマリーバー）
   ============================================ */
.answer-summary {
  margin: 6px 0 4px 48px;
  max-width: calc(100% - 48px);
  padding: 8px 12px;
  background: #faf9f7;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeInUp 0.3s ease;
  flex-shrink: 0;
}

.answer-summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-small);
  line-height: 1.4;
}

.answer-summary-label {
  color: var(--color-muted);
  min-width: 65px;
  flex-shrink: 0;
  white-space: nowrap;
}

.answer-summary-value {
  font-weight: 600;
  color: var(--color-bot-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-change-btn {
  font-size: 11px;
  font-family: var(--font-main);
  color: var(--color-accent-dark);
  background: none;
  border: 1px solid var(--color-accent);
  border-radius: 2px;
  padding: 1px 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  white-space: nowrap;
}

.answer-change-btn:hover {
  background: var(--color-accent);
  color: var(--color-accent-text);
}

.answer-change-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ============================================
   Results Grid — 景品キング商品一覧風
   ============================================ */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 10px 0 10px 48px;
  max-width: calc(100% - 48px);
  flex-shrink: 0;
}

/* --- Card --- */
.result-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  animation: fadeInUp 0.4s ease;
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.result-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  border-color: var(--color-accent);
}

/* --- Product Image --- */
.result-card .product-image-link {
  display: block;
  text-decoration: none;
}

.result-card .product-image {
  width: 100%;
  overflow: hidden;
  background: #f5f3f0;
  aspect-ratio: 1 / 1;
}

.result-card .product-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.result-card .product-image-link:hover {
  opacity: 0.85;
}

/* --- Card Info --- */
.result-card .card-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* --- Set Name --- */
.result-card .set-name-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.result-card .set-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-bot-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-card .set-name-link:hover .set-name {
  color: var(--color-primary);
}

/* --- Category Icons --- */
.result-card .category-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.result-card .cat-icon {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #f5f3f0;
  border: 1px solid #e0dbd5;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 10px;
  color: #555;
  white-space: nowrap;
}

.result-card .cat-icon-emoji {
  font-size: 12px;
  line-height: 1;
}

.result-card .cat-icon-label {
  font-weight: 600;
}

/* --- Pricing --- */
.result-card .card-pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.result-card .price-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
}

.result-card .point-value {
  font-size: var(--font-size-small);
  font-weight: 700;
  color: #f5a623;
  background: #fff8e6;
  border: 1px solid #f5d680;
  border-radius: 2px;
  padding: 1px 6px;
}

/* --- Shipping --- */
.result-card .card-shipping {
  font-size: 11px;
  color: var(--color-primary);
  font-weight: 600;
}

/* --- Feature Badges --- */
.result-card .feature-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: auto;
}

.result-card .feature-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
}

.result-card .badge-panel {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.result-card .badge-genbutsu {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
}

/* ============================================
   Post-Result Action Buttons（再検索・条件変更）
   ============================================ */
.post-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0 12px 48px;
  animation: fadeInUp 0.3s ease;
}

.post-action-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-size: var(--font-size-base);
  font-family: var(--font-main);
  font-weight: 700;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.4;
}

.post-action-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.post-action-primary {
  background: var(--color-accent);
  color: var(--color-accent-text);
  border: 2px solid var(--color-accent);
}

.post-action-primary:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(245, 166, 35, 0.3);
}

.post-action-secondary {
  background: #fff;
  color: var(--color-accent-dark);
  border: 2px solid var(--color-accent);
}

.post-action-secondary:hover {
  background: var(--color-accent);
  color: var(--color-accent-text);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(245, 166, 35, 0.3);
}

.post-action-outline {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
}

.post-action-outline:hover {
  color: var(--color-bot-text);
  border-color: #aaa;
}

.post-action-search {
  background: #fff;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
  font-weight: 700;
}

.post-action-search:hover {
  background: var(--color-accent);
  color: var(--color-accent-text);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(245, 166, 35, 0.3);
}

@media (max-width: 480px) {
  .post-actions {
    padding-left: 0;
  }
}

/* ============================================
   Input Area (footer)
   ============================================ */
.input-area {
  flex-shrink: 0;
  padding: 8px 16px 16px;
  border-top: 2px solid var(--color-border);
  background: var(--color-bg);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Cascade animation for options --- */
.cascade-in {
  opacity: 0;
  transform: translateY(8px);
  animation: cascadeFadeIn 0.25s ease forwards;
}

@keyframes cascadeFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (min-width: 768px) {
  #app {
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
  }
}

@media (max-width: 480px) {
  .header-top {
    padding: 10px 14px;
    gap: 8px;
  }

  .header-logo-icon {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }

  #header h1 {
    font-size: 15px;
  }

  .header-subtitle {
    font-size: 10px;
    display: none;
  }

  .restart-btn {
    font-size: 11px;
    padding: 5px 10px;
  }

  .options-container,
  .action-buttons,
  .custom-input-container {
    padding-left: 0;
  }

  .option-btn, .chip-btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* --- Answer Summary: モバイル --- */
  .answer-summary {
    margin-left: 0;
    max-width: 100%;
  }

  /* --- Results Grid: モバイル横並びカード --- */
  .results-grid {
    grid-template-columns: 1fr;
    margin-left: 0;
    max-width: 100%;
    gap: 10px;
  }

  .result-card {
    flex-direction: row;
  }

  .result-card .product-image-wrapper {
    width: 38%;
    flex-shrink: 0;
  }

  .result-card .product-image-link {
    display: block;
    height: 100%;
  }

  .result-card .product-image {
    aspect-ratio: auto;
    height: 100%;
  }

  .result-card .product-image img {
    height: 100%;
    object-fit: cover;
  }

  .result-card .card-info {
    padding: 8px 10px;
    gap: 4px;
  }

  .result-card .set-name {
    font-size: 12px;
  }

  .result-card .price-value {
    font-size: var(--font-size-large);
  }

  .result-card .cat-icon-label {
    display: none;
  }

  .result-card .cat-icon {
    padding: 2px 4px;
  }

  .result-card .cat-icon-emoji {
    font-size: 14px;
  }
}

@media (max-width: 374px) {
  :root {
    --font-size-base: 13px;
    --bubble-padding: 10px 12px;
  }
}

/* ============================================
   Help Trigger Button (? マーク)
   ============================================ */
.help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: var(--color-accent-dark);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main);
  border: 2px solid var(--color-accent);
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1;
  transition: all 0.15s;
  box-shadow: 0 1px 4px rgba(245, 166, 35, 0.3);
  animation: helpPulse 3s ease-in-out infinite;
}

@keyframes helpPulse {
  0%, 80%, 100% { transform: scale(1); }
  87% { transform: scale(1.3); }
  94% { transform: scale(1); }
}

.help-trigger:hover {
  background: var(--color-accent);
  color: var(--color-accent-text);
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.4);
}

/* ============================================
   Help Modal Overlay
   ============================================ */
.help-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 16px;
}

.help-modal-overlay.active {
  opacity: 1;
}

.help-modal {
  background: #fff;
  border-radius: 8px;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.help-modal-overlay.active .help-modal {
  transform: translateY(0);
}

.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-light);
  border-radius: 8px 8px 0 0;
}

.help-modal-title {
  font-size: var(--font-size-large);
  font-weight: 700;
  color: var(--color-bot-text);
}

.help-modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  font-size: 22px;
  color: var(--color-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s;
}

.help-modal-close:hover {
  background: #eee;
  color: var(--color-bot-text);
}

.help-modal-body {
  padding: 16px 18px 20px;
}

.help-modal-body .help-desc {
  font-size: var(--font-size-base);
  line-height: 1.7;
  color: var(--color-bot-text);
  margin-bottom: 14px;
}

.help-modal-body .help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 14px;
}

.help-modal-body .help-table th {
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-weight: 700;
  padding: 8px 10px;
  text-align: left;
  font-size: 12px;
  white-space: nowrap;
}

.help-modal-body .help-table th:first-child {
  border-radius: 4px 0 0 0;
}

.help-modal-body .help-table th:last-child {
  border-radius: 0 4px 0 0;
}

.help-modal-body .help-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.5;
}

.help-modal-body .help-table tr:nth-child(even) {
  background: #faf9f7;
}

.help-modal-body .help-table td:first-child {
  white-space: nowrap;
  font-weight: 600;
  color: var(--color-accent-dark);
}

.help-modal-body .help-table td:nth-child(2) {
  font-weight: 700;
  white-space: nowrap;
}

.help-modal-body .help-note {
  font-size: var(--font-size-small);
  color: var(--color-muted);
  line-height: 1.6;
  background: #faf9f7;
  padding: 10px 12px;
  border-radius: 4px;
  border-left: 3px solid var(--color-accent);
}

@media (max-width: 480px) {
  .help-modal {
    max-width: 100%;
    max-height: 85vh;
  }

  .help-modal-body .help-table {
    font-size: 12px;
  }

  .help-modal-body .help-table th,
  .help-modal-body .help-table td {
    padding: 6px 8px;
  }
}

/* ============================================
   Quick View - …ボタン
   ============================================ */
.product-image-wrapper {
  position: relative;
}

.quick-view-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: opacity 0.2s;
}

.quick-view-btn img {
  display: block;
  width: 30px;
  height: 30px;
  animation: quickViewPulse 1.5s ease-in-out infinite;
}
.quick-view-btn:hover img {
  animation-duration: 0.6s;
}
@keyframes quickViewPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ============================================
   Quick View - ボトムシートモーダル
   ============================================ */
.quick-view-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: background 0.3s ease;
}

.quick-view-overlay.active {
  background: rgba(0, 0, 0, 0.45);
}

.quick-view-modal {
  background: #fff;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  -webkit-overflow-scrolling: touch;
}

.quick-view-overlay.active .quick-view-modal {
  transform: translateY(0);
}

/* ドラッグハンドル */
.qv-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
}

.qv-handle span {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #d0ccc6;
}

/* --- カルーセル --- */
.qv-carousel {
  padding: 0 16px;
}

.qv-main-image-wrap {
  position: relative;
  background: #f5f3f0;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.qv-main-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.qv-prev, .qv-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: background 0.2s;
}

.qv-prev { left: 8px; }
.qv-next { right: 8px; }

.qv-prev:hover, .qv-next:hover {
  background: #fff;
}

.qv-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.qv-thumb {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.qv-thumb.active {
  border-color: var(--color-accent);
}

.qv-thumb:hover {
  border-color: var(--color-accent-dark);
}

/* --- 商品情報 --- */
.qv-info {
  padding: 16px;
}

.qv-product-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-bot-text);
  margin-bottom: 8px;
}

.qv-pricing {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.qv-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}

.qv-price small {
  font-size: 12px;
  font-weight: 400;
}

.qv-point {
  font-size: var(--font-size-small);
  font-weight: 700;
  color: #f5a623;
  background: #fff8e6;
  border: 1px solid #f5d680;
  border-radius: 2px;
  padding: 1px 6px;
}

/* --- セット内容 --- */
.qv-section {
  margin-bottom: 12px;
}

.qv-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-muted);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}

.qv-item-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.qv-item-list li {
  font-size: 13px;
  line-height: 1.6;
  padding: 3px 0;
  border-bottom: 1px dotted #e8e4e0;
  color: var(--color-bot-text);
}

.qv-item-list li:last-child {
  border-bottom: none;
}

.qv-panel-badge {
  font-size: 10px;
  font-weight: 700;
  color: #2e7d32;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  border-radius: 2px;
  padding: 0 4px;
  margin-left: 4px;
}

/* --- アクションボタン --- */
.qv-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-bottom: 8px;
}

.qv-detail-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--color-accent);
  color: var(--color-accent-text);
  border: none;
  border-radius: var(--btn-radius);
  font-size: var(--font-size-base);
  font-family: var(--font-main);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.qv-detail-btn:hover {
  background: var(--color-accent-dark);
}

.qv-close-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--btn-radius);
  font-size: var(--font-size-base);
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.15s;
}

.qv-close-btn:hover {
  color: var(--color-bot-text);
  border-color: #aaa;
}

/* モバイル横並びカードの…ボタン位置調整 */
@media (max-width: 480px) {
  .quick-view-btn {
    width: 26px;
    height: 26px;
    bottom: 6px;
    right: 6px;
  }

  .quick-view-btn img {
    width: 26px;
    height: 26px;
  }

  .qv-actions {
    padding-bottom: env(safe-area-inset-bottom, 8px);
  }
}

/* ============================================
   Scrollbar
   ============================================ */
.chat-area::-webkit-scrollbar {
  width: 5px;
}

.chat-area::-webkit-scrollbar-track {
  background: transparent;
}

.chat-area::-webkit-scrollbar-thumb {
  background: #d0ccc6;
  border-radius: 3px;
}

.chat-area::-webkit-scrollbar-thumb:hover {
  background: #b0aca6;
}
