/* 君斗りんく AI返信アシスタント - スタイル */
/* dns-osint-pro-ver2.0のデザインベース */
@layer base, popup, options-page;

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

@layer popup {
body:not(.options-page) {
  width: 420px;
  max-height: 650px;
  min-height: 400px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #ffffff;
  color: #333;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* サイドパネルモード：ブラウザ確保幅に合わせて伸縮 */
body.side-panel-mode {
  width: 100%;
  max-width: 100%;
  max-height: 100vh;
  min-height: 100vh;
  overflow-y: auto;
}

/* --- サイドパネル レスポンシブ --- */

/* ヘッダー: 狭い幅ではコンパクトに */
body.side-panel-mode header {
  padding: 10px 12px;
}

body.side-panel-mode .header-content {
  gap: 10px;
  margin-bottom: 6px;
}

body.side-panel-mode .header-logo {
  width: 36px;
  height: 36px;
  padding: 3px;
  border-width: 2px;
  flex-shrink: 0;
}

body.side-panel-mode .header-title {
  font-size: 13px;
  line-height: 1.3;
  word-break: keep-all;
}

body.side-panel-mode .header-subtitle {
  font-size: 10px;
}

body.side-panel-mode .header-note {
  font-size: 8px;
}

/* メインコンテンツ: パディング調整 */
body.side-panel-mode main {
  padding: 10px;
}

/* 全般: テキスト折り返しを適切に */
body.side-panel-mode * {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ボタン: 狭幅でもタップしやすく */
body.side-panel-mode button {
  min-height: 40px;
  font-size: 13px;
}

/* バックアップ警告: 狭い幅でコンパクトに */
body.side-panel-mode #backupWarning strong {
  font-size: 12px;
}

/* インテントパレット: 狭い幅では縦並び */
body.side-panel-mode .intent-palette-row {
  flex-direction: column;
}

body.side-panel-mode .intent-btn {
  min-width: auto;
  width: 100%;
}

/* スタイル選択: 狭い幅ではグリッド2列に */
body.side-panel-mode #styleSelector {
  flex-wrap: wrap;
}

body.side-panel-mode #styleSelector button {
  flex: 1 1 40%;
  min-width: 0;
  font-size: 11px;
  padding: 6px 8px;
}

/* フィードバックボタン: 狭い幅で折り返し */
body.side-panel-mode .feedback-btn {
  font-size: 11px;
  padding: 8px 10px;
  min-height: 38px;
}

body.side-panel-mode .feedback-btn--primary {
  min-width: 100%;
}

/* サポートリンク: 狭い幅でも見やすく */
body.side-panel-mode .form-section div[style*="display:flex"][style*="gap:8px"][style*="flex-wrap:wrap"] a {
  min-width: 60px;
}

/* 300px未満の極狭幅 */
@media (max-width: 299px) {
  body.side-panel-mode .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  body.side-panel-mode .header-logo {
    width: 30px;
    height: 30px;
  }

  body.side-panel-mode .header-title {
    font-size: 12px;
  }

  body.side-panel-mode .header-subtitle {
    font-size: 9px;
  }

  body.side-panel-mode .header-note {
    display: none;
  }

  body.side-panel-mode main {
    padding: 8px;
  }

  body.side-panel-mode #backupWarning {
    padding: 8px;
  }

  body.side-panel-mode #backupWarning strong {
    font-size: 11px;
  }
}

/* 350px以上の中間幅 */
@media (min-width: 350px) {
  body.side-panel-mode .header-title {
    font-size: 14px;
  }

  body.side-panel-mode .intent-palette-row {
    flex-direction: row;
  }

  body.side-panel-mode .intent-btn {
    width: auto;
  }
}

/* 450px以上の広い幅 */
@media (min-width: 450px) {
  body.side-panel-mode .header-logo {
    width: 44px;
    height: 44px;
  }

  body.side-panel-mode .header-title {
    font-size: 15px;
  }

  body.side-panel-mode .header-subtitle {
    font-size: 11px;
  }

  body.side-panel-mode .header-note {
    font-size: 9px;
  }

  body.side-panel-mode .feedback-btn--primary {
    min-width: 120px;
  }
}

}

@layer options-page {
/* optionsページは全幅・全高でOK（options.htmlの<style>が主導） */
body.options-page {
  width: auto;
  max-width: 100%;
}
}

@layer base {
/* ヘッダー */
header {
  padding: 12px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.header-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: contain;
  background: white;
  padding: 4px;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.header-logo:hover {
  transform: scale(1.05) rotate(5deg);
}

.header-text {
  flex: 1;
}

/* キャラクター画像のアニメーション */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-3deg);
  }
  75% {
    transform: rotate(3deg);
  }
}

.character-img {
  transition: transform 0.3s ease;
  cursor: pointer;
}

.character-img:hover {
  transform: scale(1.1) translateY(-3px);
  animation: wiggle 0.5s ease-in-out;
}

.bookmark-title-char {
  pointer-events: none;
}

.bookmark-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.bookmark-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.25);
}

.bookmark-action-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

/* 吹き出しのアニメーション */
@keyframes fadeInBubble {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.header-title {
  font-size: 16px;
  margin: 0 0 4px 0;
}

.header-subtitle {
  margin: 0 0 3px 0;
  font-size: 11px;
  color: #fff;
  font-weight: normal;
  opacity: 0.9;
}

.header-note {
  font-size: 9px;
  color: #fff;
  margin: 0;
  opacity: 0.9;
}

/* メインコンテナ */
main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f5f5f5;
  padding: 15px;
}

/* フォームセクション */
.form-section {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.form-row {
  margin-bottom: 12px;
}

.form-row:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #5b3a8f;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  border: 2px solid #ddd;
  border-radius: 6px;
  resize: vertical;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: #5b3a8f;
  box-shadow: 0 0 0 3px rgba(91, 58, 143, 0.1);
}

textarea.context {
  min-height: 120px;
}

textarea.notes {
  min-height: 80px;
}

select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

select:focus {
  outline: none;
  border-color: #5b3a8f;
  box-shadow: 0 0 0 3px rgba(91, 58, 143, 0.1);
}

/* ボタン */
.button-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

button {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

button.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

button.primary:hover {
  background: linear-gradient(135deg, #7a8ff0 0%, #8a5fb8 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

button.primary:active {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4f98 100%);
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

button.secondary {
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

button.secondary:hover {
  background: linear-gradient(135deg, #9b6cf6 0%, #b78bfa 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

button.tertiary {
  background: #e0e0e0;
  color: #666;
}

button.tertiary:hover {
  background: #d0d0d0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 出力エリア */
.output-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.output-title {
  font-size: 16px;
  font-weight: 600;
  color: #5b3a8f;
}

.output-content {
  background: #f7f7f7;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  padding: 15px;
  min-height: 120px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

.output-content.empty {
  color: #999;
  font-style: italic;
}

/* ステータス */
.status-bar {
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-bar.info {
  background: #e3f2fd;
  color: #1565c0;
  border-left: 4px solid #1976d2;
}

.status-bar.success {
  background: #e8f5e9;
  color: #2e7d32;
  border-left: 4px solid #4caf50;
}

.status-bar.error {
  background: #ffebee;
  color: #c62828;
  border-left: 4px solid #f44336;
}

.status-bar.loading {
  background: #fff3e0;
  color: #e65100;
  border-left: 4px solid #ff9800;
}

/* パックマン風アニメーション */
@keyframes pacman-eat {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-45deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(45deg);
  }
}

@keyframes dot-bounce {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 回転アニメーション */
@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* スピンアニメーション（ローディング用） */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* バウンスアニメーション（スタイル選択時） */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* りんく想像中アニメーション（気持ち予測・分析時） */
@keyframes link-imagine {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateY(-4px) scale(1.03);
    opacity: 0.95;
  }
}

/* 想像中のきらきらドット */
@keyframes imagine-dots {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* 流れ星アニメーション */
@keyframes shooting-star {
  0% {
    transform: translateX(-100px) translateY(100px) rotate(45deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateX(800px) translateY(-800px) rotate(45deg);
    opacity: 0;
  }
}

.shooting-star {
  position: absolute;
  width: 2px;
  height: 100px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%);
  border-radius: 50%;
  animation: shooting-star 3s linear infinite;
}

.shooting-star::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 10px #ffffff, 0 0 20px #ffffff;
}

/* 天の川アニメーション */
@keyframes milky-way {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.milky-way {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.1) 20%,
    rgba(255,255,255,0.3) 50%,
    rgba(255,255,255,0.1) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: milky-way 8s linear infinite;
  opacity: 0.6;
}

/* きらめく星 */
@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.twinkle-star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 6px #ffffff, 0 0 12px #ffffff;
  animation: twinkle 2s ease-in-out infinite;
}

/* スクロールバー */
main::-webkit-scrollbar {
  width: 8px;
}

main::-webkit-scrollbar-track {
  background: #f5f5f5;
}

main::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

main::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* Hover効果用クラス (CSP対応) */
.hover-scale {
  transition: all 0.3s;
}

.hover-scale:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.hover-scale-border {
  transition: all 0.3s;
}

.hover-scale-border:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: #4caf50;
}

/* 2列レイアウト */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 700px) {
  .two-column {
    grid-template-columns: 1fr;
  }
}

/* =================================== */
/* LINE風返信候補UI */
/* =================================== */
#suggestionArea {
  background: white;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  animation: fadeInUp 0.3s ease-out;
}

.suggestion-section-header {
  font-size: 12px;
  font-weight: bold;
  color: #666;
  margin: 12px 0 6px 0;
  padding: 6px 10px;
  background: #f5f5f5;
  border-radius: 6px;
  border-left: 3px solid #7B68EE;
}

.suggestion-header {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 600;
}

.suggestion-item {
  padding: 10px 12px;
  margin: 6px 0;
  background: #f7f7f7;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.suggestion-item:hover {
  background: #e8f5e9;
  border-color: #06c755;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(6, 199, 85, 0.2);
}

.suggestion-item:active {
  transform: scale(0.98);
}

.suggestion-label {
  display: inline-block;
  font-size: 10px;
  color: #06c755;
  font-weight: bold;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.suggestion-text {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: #333;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
  max-height: none;
  overflow: visible;
}

/* フェードインアニメーション */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* フィードバックバー（2段構成・見やすいUI） */
.intent-palette {
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.intent-palette-title {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

.intent-palette-hint {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.4;
}

.intent-palette-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.intent-btn {
  flex: 1;
  min-width: 88px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.intent-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.intent-btn--active {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #5b21b6;
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.2);
}

/* Transformのローディング中だけ、りんくが探している演出（目立つ版） */
#transformResult.transform-result--loading {
  box-shadow: 0 0 0 rgba(99, 102, 241, 0.25), 0 6px 18px rgba(59, 130, 246, 0.18);
  animation: link-search-card-pulse 1.25s ease-in-out infinite;
}

#transformResult.transform-result--loading #transformResultAvatar {
  animation: link-search-float 1s ease-in-out infinite;
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform;
}

#transformResult.transform-result--loading #transformResultSpark {
  animation: link-search-twinkle 0.75s ease-in-out infinite;
  transform-origin: center;
}

#transformResult.transform-result--loading #transformResultLead {
  animation: link-search-lead-glow 1.1s ease-in-out infinite;
}

#transformResult.transform-result--loading #transformResultSearchingDots {
  display: inline-block;
  font-size: 13px;
  margin-left: 2px;
  animation: link-search-dots 0.9s steps(3, end) infinite;
}

@keyframes link-search-card-pulse {
  0% {
    box-shadow: 0 0 0 rgba(99, 102, 241, 0.18), 0 6px 16px rgba(59, 130, 246, 0.16);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.10), 0 10px 24px rgba(59, 130, 246, 0.24);
  }
  100% {
    box-shadow: 0 0 0 rgba(99, 102, 241, 0.18), 0 6px 16px rgba(59, 130, 246, 0.16);
  }
}

@keyframes link-search-float {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-1px) rotate(-1.5deg); }
  50% { transform: translateY(-2px) rotate(1.5deg); }
  75% { transform: translateY(-1px) rotate(-1deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@keyframes link-search-twinkle {
  0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.8; }
  50% { transform: translateY(-1px) rotate(16deg) scale(1.15); opacity: 1; }
  100% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.8; }
}

@keyframes link-search-lead-glow {
  0% { color: #6d28d9; text-shadow: none; }
  50% { color: #5b21b6; text-shadow: none; }
  100% { color: #6d28d9; text-shadow: none; }
}

@keyframes link-search-dots {
  0% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
  100% { opacity: 0.2; transform: translateY(0); }
}

/* 定型文・履歴セクションの共通ヘッダー（同じ構造が2箇所） */
.section-header-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.section-header-title {
  flex: 1;
  padding: 8px 12px;
  background: #8b5cf6;
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header-title .character-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
}
.section-header-clear {
  padding: 8px 16px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  white-space: nowrap;
}

.feedback-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.feedback-bar-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-bar-row + .feedback-bar-row {
  margin-top: 8px;
}

.feedback-bar-row--primary {
  gap: 10px;
}

.feedback-btn {
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
}

.feedback-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

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

/* メイン操作：「気持ち付きでコピー」を目立たせる */
.feedback-btn--primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  border: none;
  color: #fff;
  flex: 1;
  min-width: 120px;
}

.feedback-btn--primary:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
}

/* 小さいボタン（フィードバック用） */
.feedback-btn--small {
  padding: 8px 12px;
  min-height: 36px;
  font-size: 12px;
}

/* 改善要望ボタン */
.feedback-btn--improve {
  background: #10b981;
  border: none;
  color: #fff;
  font-weight: 600;
}

.feedback-btn--improve:hover {
  background: #059669;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

/* 狭い画面ではボタンを縦に並べる */
@media (max-width: 320px) {
  .feedback-bar-row {
    flex-direction: column;
  }
  .feedback-btn--primary {
    min-width: 100%;
  }
}

/* 後方互換 */
#feedbackBar button {
  transition: all 0.2s ease;
}

/* ================================================ */
/* サイドパネル スポットライト式チュートリアル      */
/* ================================================ */
.sp-tour {
  position: fixed;
  inset: 0;
  z-index: 99999;
  overflow: hidden;
  cursor: pointer;
}

/* 各ステップ：画面全体 */
.sp-tour-step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  animation: spFadeIn 0.5s ease-out;
}

@keyframes spFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* スポットライト（キャラの背後に光る円） */
.sp-tour-spotlight {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -65%);
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.35) 0%, rgba(124,58,237,0.12) 40%, transparent 70%);
  box-shadow: 0 0 80px 40px rgba(124, 58, 237, 0.15);
  animation: spPulse 2.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes spPulse {
  0%, 100% { transform: translate(-50%, -65%) scale(1); opacity: 1; }
  50%      { transform: translate(-50%, -65%) scale(1.08); opacity: 0.8; }
}

/* ステップごとにスポットライト色を変える */
.sp-tour-step[data-step="0"] .sp-tour-spotlight {
  background: radial-gradient(circle, rgba(124,58,237,0.4) 0%, rgba(124,58,237,0.12) 40%, transparent 70%);
  box-shadow: 0 0 80px 40px rgba(124,58,237,0.18);
}
.sp-tour-step[data-step="1"] .sp-tour-spotlight {
  background: radial-gradient(circle, rgba(245,158,11,0.4) 0%, rgba(245,158,11,0.12) 40%, transparent 70%);
  box-shadow: 0 0 80px 40px rgba(245,158,11,0.18);
}
.sp-tour-step[data-step="2"] .sp-tour-spotlight {
  background: radial-gradient(circle, rgba(16,185,129,0.4) 0%, rgba(16,185,129,0.12) 40%, transparent 70%);
  box-shadow: 0 0 80px 40px rgba(16,185,129,0.18);
}
.sp-tour-step[data-step="3"] .sp-tour-spotlight {
  background: radial-gradient(circle, rgba(59,130,246,0.4) 0%, rgba(59,130,246,0.12) 40%, transparent 70%);
  box-shadow: 0 0 80px 40px rgba(59,130,246,0.18);
}

/* キャラクター */
.sp-tour-chara {
  position: relative;
  z-index: 2;
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(255,255,255,0.5));
  animation: spFloat 2.5s ease-in-out infinite;
  margin-bottom: 20px;
}

@keyframes spFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* 吹き出し */
.sp-tour-speech {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px;
  margin: 0 16px 20px;
  text-align: center;
  font-size: 18px;
  line-height: 2;
  color: #1f2937;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 100%;
  animation: spBubbleIn 0.4s ease-out 0.15s both;
}

@keyframes spBubbleIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 吹き出しの三角 */
.sp-tour-speech::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 12px solid #fff;
}

.sp-tour-speech b {
  color: #7c3aed;
  font-size: 20px;
}

/* 「タップして次へ」 */
.sp-tour-tap {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  animation: spTapPulse 1.8s ease-in-out infinite;
  margin-top: 8px;
}

@keyframes spTapPulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* ドットインジケーター */
.sp-tour-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.sp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.3s;
}

.sp-dot.active {
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  transform: scale(1.3);
}
}