/* ========================================
   全体・共通スタイル
   ======================================== */
html {
  width: 100%;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans",
    "Noto Sans CJK JP", "Original Yu Gothic", "Yu Gothic", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  margin: 0;
  width: 100%;
  background: var(--body-bg);
  color: var(--text-primary);
  box-sizing: border-box;
}

a {
  color: var(--info-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========================================
   コンテナ・レイアウト
   ======================================== */
.main-container {
  width: 100%;
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* エディタ画面では全画面表示に（クラス指定で確実に適用）
   編集画面の main 直下は .lp-editor-fixed-header → .editor-container の順。
   max-width: 100vw で main をビューポート幅に制限し、
   子の .lp-editor-fixed-header（width: 100%）がタブレット幅でも見切れないようにする。 */
main.main-container.main-container--editor,
main.main-container:has(.editor-container) {
  max-width: 100vw;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* エディタ画面でHTML最上位から右余白が出ないようにする */
body:has(main.main-container--editor) {
  overflow-x: hidden;
}

/* 管理画面では全画面表示に */
main.main-container:has(.admin-container) {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* AIクレジット0時の共通バナー */
.ai-credit-zero-banner {
  display: block;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--alert-warning-bg);
  border: 1px solid var(--warning-color);
  border-radius: 6px;
  color: var(--alert-warning-text);
  font-size: 0.9375rem;
}

/* ========================================
   ヘッダー・フッター (Updated: 2025-01-10)
   ======================================== */
.site-header {
  background: var(--theme-gradient);
  padding: 0 2rem;
  border-bottom: none;
  box-shadow: 0 4px 20px rgba(var(--theme-navy-rgb), 0.15);
  position: sticky;
  top: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
}

/* ヘッダー8方針: 外枠2カラム・高さ固定・縦中央 */
.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: calc(100% - 4rem);
  margin: 0 2rem;
  height: 60px;
  box-sizing: border-box;
  gap: 2rem;
}

/* 左ブロック: 横並びの基準（ロゴ＋ナビを flex + gap で固定） */
.header__left {
  display: flex;
  align-items: center;
  gap: 1rem; /* 12〜16px */
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
}

/* ロゴ: 縮まない（flex: 0 0 auto）。テキストは長いとき省略 */
.header__left .logo {
  flex: 0 0 auto;
}

.header__left .logo-text {
  display: block; /* 共通の display:none を打ち消す */
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header__left .logo-main {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 主ナビ: 必要分だけ幅、足りなければ縮む（flex: 0 1 auto）+ min-width:0 で省略が効く。480px 以下で非表示（B案） */
.header__main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.header__main-nav a {
  color: var(--white-90);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    text-decoration 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.header__main-nav a:hover {
  color: var(--white);
  background: var(--white-10);
}

/* 右側: 2グループ・同じサイズのピル */
.header__utility {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.header__utility-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 共通ピル: 管理画面・ログアウト */
.header__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 36px;
  padding: 0 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  color: var(--white-95);
  background: var(--white-08);
  border: 1px solid var(--white-15);
}

.header__pill:hover {
  background: var(--white-15);
  color: var(--white);
  text-decoration: none;
}

a.header__pill[href*="logout"] {
  background: rgba(var(--danger-rgb), 0.2);
  border-color: rgba(var(--danger-rgb), 0.3);
}

a.header__pill[href*="logout"]:hover {
  background: rgba(var(--danger-rgb), 0.3);
}

/* アカウント表示（ユーザー名・省略可） */
.header__account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  min-width: 0;
}

.header__account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--white-20);
  border-radius: 50%;
  color: var(--white);
}

.header__account-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* AI残: シンプル2行表示（中央揃え・1px枠） */
.header__ai-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  padding: 0.25rem 0.5rem;
  font-weight: normal;
  font-size: 0.6rem;
  color: var(--white-90);
  border: 1px solid var(--white-25);
  cursor: default;
  position: relative;
}

.header__ai-pill .header__ai-line1,
.header__ai-pill .usage-line2,
.header__ai-pill .usage-remaining {
  color: inherit;
  font-size: 0.6rem;
  text-align: center;
}

.header__ai-pill.updating {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.header__ai-pill-warning {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--danger-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  animation: header-pulse 2s infinite;
}

@keyframes header-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ヘッダー・ユーザーメニュー（ハンバーガー）ドロップダウン */
.header__user-menu {
  position: relative;
}

.header__hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--white-90);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.header__hamburger:hover {
  background: var(--white-10);
  color: var(--white);
}

.header__menu-panel {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 200px;
  padding: 0.75rem 0;
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  z-index: 200;
}

.header__user-menu.is-active .header__menu-panel {
  display: block;
}

.header__menu-user-name {
  padding: 0.5rem 1rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
}

.header__menu-user-id {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.header__menu-divider {
  height: 1px;
  margin: 0.5rem 0;
  background: var(--gray-200);
  border: none;
}

.header__menu-item {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: var(--info-link);
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease;
  white-space: nowrap;
}

.header__menu-item:hover {
  background: var(--gray-50);
  color: var(--info-dark);
  text-decoration: none;
}

.header__menu-item.is-active {
  font-weight: 500;
  color: var(--gray-800);
}

.header__menu-item--logout {
  color: var(--danger-color);
}

.header__menu-item--logout:hover {
  background: var(--alert-error-bg);
  color: var(--danger-dark);
}

/* ロゴスタイル（ヘッダー・error・success 共通）: 固定高さのフレックス＋画像は箱に収める */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* 8〜12px */
  text-decoration: none;
  transition: all 0.3s ease;
  justify-content: flex-start;
}

.logo:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

/* ロゴの箱: 高さ基準・幅は画像のアスペクト比に従う（logo-white.png は 4220×849 の横長） */
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: auto;
  min-width: 0;
  max-width: 200px;
  flex-shrink: 0;
}

/* 画像は箱に収める（height 強制指定は廃止） */
.logo-icon img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

.logo-text {
  display: none;
}

.logo-main {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  text-shadow: 0 2px 4px var(--black-15);
  letter-spacing: -0.02em;
}

.site-footer-bottom {
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
  color: var(--secondary-color);
}

/* ========================================
   ボタン（共通） - デザインシステムに統合
   ======================================== */
/* 既存のボタンクラスは後方互換性のため残すが、デザインシステムのクラスを推奨 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--theme-navy-rgb), 0.1);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.button-primary {
  background: var(--theme-gradient);
  color: var(--white);
  box-shadow: 0 1px 2px 0 var(--black-05);
}

.button-primary:hover:not(:disabled) {
  background: var(--theme-gradient-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.button-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  box-shadow: 0 1px 2px 0 var(--black-05);
}

.button-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--theme-navy);
  color: var(--theme-navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.button-logout {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  box-shadow: 0 1px 2px 0 var(--black-05);
  font-size: 0.8rem;
}

.button-logout:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--theme-navy);
  color: var(--theme-navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.button-danger {
  background: var(--danger-gradient);
  color: var(--white);
  box-shadow: 0 1px 2px 0 var(--black-05);
}

.button-danger:hover:not(:disabled) {
  background: linear-gradient(
    135deg,
    var(--danger-dark) 0%,
    var(--danger-hover-end) 100%
  );
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.button-delete {
  background: var(--white);
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
  box-shadow: 0 1px 2px 0 var(--black-05);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.button-delete:hover:not(:disabled) {
  background: var(--danger-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.button-delete i {
  font-size: 0.85rem;
}

.button-action {
  background: var(--info-gradient);
  color: var(--white);
  box-shadow: 0 1px 2px 0 var(--black-05);
}

.button-action:hover:not(:disabled) {
  background: linear-gradient(
    135deg,
    var(--info-dark) 0%,
    var(--info-hover-end) 100%
  );
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.button-complete {
  background: var(--success-gradient);
  color: var(--white);
  box-shadow: 0 1px 2px 0 var(--black-05);
}

.button-complete:hover:not(:disabled) {
  background: linear-gradient(
    135deg,
    var(--success-dark) 0%,
    var(--success-hover-end) 100%
  );
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.button-info {
  background: var(--info-gradient);
  color: var(--white);
  box-shadow: 0 1px 2px 0 var(--black-05);
}

.button-info:hover:not(:disabled) {
  background: linear-gradient(
    135deg,
    var(--info-dark) 0%,
    var(--info-hover-end) 100%
  );
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.button-link {
  background: none;
  color: var(--theme-navy);
  border: 1px solid var(--gray-300);
  box-shadow: none;
  padding: 0.5rem 0.75rem;
}

.button-link:hover:not(:disabled) {
  background: var(--gray-50);
  color: var(--theme-navy-light);
  transform: none;
  box-shadow: none;
}

/* ========================================
   フォーム（共通）
   ======================================== */
.form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-400);
  border-radius: 4px;
  box-sizing: border-box;
}

.form-section {
  margin-bottom: 2rem;
}

.form-label-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.form-label {
  font-weight: bold;
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0;
}

.form-checkboxes {
  display: flex;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
}

.checkbox-label span {
  user-select: none;
}

.form-help {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0.5rem 0;
}

/* 注意書きセクション（ステップ3・4で共通） */
.step-note {
  background-color: var(--alert-warning-bg);
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 1rem 0;
  border-radius: 4px;
  text-align: center;
}
.step-note .help {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.step-note .bulk-ai-trigger {
  margin-top: var(--spacing-md);
}

/* SERP キーワード候補（ステップ3） */
.serpapi-keyword-suggestions-list {
  margin-top: 0.5rem;
  line-height: 1.8;
}
.serpapi-kw-tag {
  display: inline-block;
  margin: 0 0.5rem 0.25rem 0;
  padding: 0.2rem 0.5rem;
  background: var(--gray-100, #f3f4f6);
  border-radius: 4px;
  font-size: 0.9rem;
}

.serpapi-keyword-suggestions-by-source {
  margin-top: 0.5rem;
}
.serpapi-kw-source-section {
  margin-bottom: 1rem;
}
.serpapi-kw-source-section:last-child {
  margin-bottom: 0;
}
.serpapi-kw-source-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.serpapi-kw-source-section .serpapi-keyword-suggestions-list {
  margin-top: 0;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 1rem;
  line-height: 1.5;
  background: var(--secondary-light);
}

/* フォームセクション（LP・Thanks 編集・管理画面等で使用） */
.form-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border-lighter);
  border-radius: 8px;
  background: var(--white);
}

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

/* ========================================
   カラーパレット
   ======================================== */
.color-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding: 0.8rem;
  background: var(--secondary-light);
  border-radius: 6px;
  border: 1px solid var(--border-lighter);
  max-width: 200px;
}

.color-palette-item {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px var(--black-10);
}

.color-palette-item:hover {
  transform: scale(1.15);
  border-color: var(--info-link);
  box-shadow: 0 2px 8px rgba(var(--info-link-rgb), 0.4);
  z-index: 10;
}

.color-palette-item.active {
  border-color: var(--info-link);
  box-shadow: 0 0 0 2px rgba(var(--info-link-rgb), 0.3);
  transform: scale(1.1);
}

.color-palette-item::after {
  content: "✓";
  color: var(--white);
  font-size: 10px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-shadow: 0 0 2px var(--black-80);
}

.color-palette-item.active::after {
  opacity: 1;
}

/* カラーパレットのカテゴリ */
.color-palette-category {
  margin-bottom: 0.8rem;
}

.color-palette-category h4 {
  margin: 0 0 0.3rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* グラデーション用の特別なスタイル */
.gradient-palette-item {
  background: linear-gradient(45deg, var(--start-color), var(--end-color));
  position: relative;
}

.gradient-palette-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    var(--white-30) 50%,
    transparent 70%
  );
  border-radius: 6px;
}

/* カラーパレットのトグルボタン */
.color-palette-toggle {
  background: var(--secondary-light);
  border: 1px solid var(--border-lighter);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

.color-palette-toggle:hover {
  background: var(--border-lighter);
  color: var(--text-primary);
}

.color-palette-toggle.active {
  background: var(--info-link);
  color: var(--white);
  border-color: var(--info-link);
}

/* ========================================
   グラデーションカスタマイザー
   ======================================== */
.gradient-customizer {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--secondary-light);
  border-radius: 6px;
  border: 1px solid var(--border-lighter);
}

.gradient-customizer h4 {
  margin: 0 0 0.8rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gradient-color-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.gradient-color-picker label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 50px;
}

.gradient-start-color,
.gradient-end-color {
  width: 40px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  cursor: pointer;
  background: none;
}

.apply-gradient-btn {
  background: var(--info-link);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background-color 0.2s ease;
}

.apply-gradient-btn:hover {
  background: var(--info-link-hover);
}

.gradient-preview {
  height: 40px;
  border-radius: 4px;
  margin-top: 0.5rem;
  border: 1px solid var(--gray-300);
  box-shadow: 0 1px 3px var(--black-10);
}

/* ========================================
   ログイン画面
   ======================================== */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
}

.login-container {
  background: var(--white);
  padding: 2rem 3rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--black-10);
  text-align: center;
  min-width: 320px;
  max-width: 420px;
  width: 100%;
}

.login-container h1 {
  margin-top: 0;
}

.login-container .form-group input {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
}

.errors {
  color: red;
  margin-bottom: 1rem;
  list-style: none;
  padding: 0;
  font-size: 0.9rem;
}

.login-message {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.login-forgot {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.login-forgot a {
  color: var(--theme-navy);
}

/* ========================================
   ダッシュボード
   ======================================== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.document-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  box-shadow: 0 2px 4px var(--black-05);
}

.document-table th,
.document-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.document-table th {
  background: var(--secondary-light);
}

.document-table tbody tr {
  transition: background-color 0.15s ease;
}

.document-table tbody tr:hover {
  background: var(--gray-100);
}

.document-table td a.edit-link {
  font-weight: bold;
}

.no-documents {
  text-align: center;
  padding: 3rem;
  background: var(--white);
}

/* ========================================
   ドロップダウン（共通スタイル）
   ======================================== */
.dropdown,
.action-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: white;
  min-width: 280px;
  box-shadow: 0 8px 16px 0 var(--black-20);
  z-index: 10;
  border-radius: 4px;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

/* クリック表示制御 */
.dropdown.is-active .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.dropdown-item:hover {
  background-color: var(--gray-100);
  text-decoration: none;
}

.dropdown-item small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.dropdown-divider {
  margin: 0.25rem 0;
  border: 0;
  border-top: 1px solid var(--gray-200);
}

/* アクションドロップダウン固有のスタイル */
.action-dropdown .dropdown-menu {
  min-width: 120px;
  font-size: 0.9rem;
}

/* ========================================
   2分割エディタレイアウト
   ======================================== */
.editor-container {
  display: flex;
  height: calc(100vh - 61px); /* ヘッダーの高さを引く */
  overflow: hidden;
}

/* 左側：編集パネル（スクロール時も右端余白を常時確保しない） */
.editor-panel {
  flex: 0 0 450px;
  min-width: 0;
  background: var(--secondary-light);
  overflow-y: auto;
  scrollbar-gutter: auto;
  padding: 1.5rem;
  border-right: 1px solid var(--gray-300);
  display: flex;
  flex-direction: column;
}

/* 右側：プレビューパネル */
.preview-panel {
  flex: 1 1 auto;
  background: var(--border-lighter);
  display: flex;
  flex-direction: column;
}

/* 768px 以下で表示する編集/プレビュー切り替えタブ（LP・Thanks 共通） */
.editor-tabs {
  display: none;
}

.preview-controls {
  flex-shrink: 0;
  padding: 0.75rem 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.preview-window-wrapper {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: auto;
}

#preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--white);
  box-shadow: 0 4px 12px var(--black-10);
}

/* ========================================
   エディタ画面個別スタイル
   ======================================== */
.editor-form {
  background: var(--white);
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--black-05);
}

.editor-header {
  margin-bottom: 2rem;
}

.editor-header h1 {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.editor-header p {
  margin-top: 0;
  color: var(--secondary-color);
}

/* ドロップダウンUI（label と dropdown を 1 行表示） */
.category-selector {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  background: var(--secondary-light);
  padding: 1rem;
  border-bottom: 1px solid var(--border-lighter);
}

.category-label {
  flex-shrink: 0;
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.category-label i {
  margin-right: 0.5rem;
  color: var(--info-link);
}

.category-dropdown {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-lighter);
  border-radius: 6px;
  background: var(--white);
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-dropdown:focus {
  outline: none;
  border-color: var(--info-link);
  box-shadow: 0 0 0 3px rgba(var(--info-link-rgb), 0.1);
}

.category-dropdown:hover {
  border-color: var(--info-link);
}

.category-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  background: var(--white);
}

.category-panel {
  display: none;
  padding: 1rem;
  animation: fadeIn 0.3s ease-in-out;
}

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

.category-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--secondary-light);
}

.category-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-header h3 i {
  color: var(--info-link);
  font-size: 1.3rem;
}

.category-description {
  margin: 0 0 1.5rem 0;
  color: var(--secondary-color);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 黄色背景の説明文（共通） */
.explanation-note {
  margin: 0 0 1.5rem 0;
  padding: 0.75rem 1rem;
  background: var(--brand-accent-yellow-bg);
  border: 1px solid var(--brand-accent-yellow-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* AI生成機能のスタイル */
.ai-context-selector {
  min-width: 0;
  background: linear-gradient(
    90deg,
    rgba(var(--ai-gradient-start-rgb), 0.08),
    rgba(var(--ai-gradient-mid-rgb), 0.08) 64.5%,
    rgba(var(--ai-gradient-end-rgb), 0.08)
  );
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(var(--ai-gradient-start-rgb), 0.2);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  box-shadow:
    0 4px 12px rgba(var(--ai-gradient-start-rgb), 0.15),
    0 2px 4px rgba(var(--ai-gradient-mid-rgb), 0.1);
}

.ai-context-selector h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-context-selector h4 i {
  color: var(--info-link);
}

.selected-campaign-display {
  background: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  margin: 0.75rem 0;
  font-size: 0.95rem;
  color: var(--secondary-dark);
}

/* AI一括生成ボタン用の共通ラッパー。上下余白はトークンで指定。 */
.bulk-ai-trigger {
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.bulk-ai-trigger .bulk-ai-abort {
  margin-left: 0;
}

.lp-hero-candidates {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  border-left: 4px solid var(--primary, #2563eb);
  background: var(--bg-secondary, #f8fafc);
  border-radius: 0 4px 4px 0;
}

/* モーダル内では modal-content が余白を持つため、枠スタイルを弱める。flex でタイトル・リスト・アクションを縦並びにし高さを親に合わせる */
.modal-content .lp-hero-candidates {
  margin-top: 0;
  padding: 0;
  border-left: none;
  background: transparent;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.lp-hero-candidates__title {
  margin: 0 0 var(--spacing-sm);
  font-size: 1rem;
  font-weight: 600;
}

.lp-hero-candidates__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

/* モーダル内ではリストのみスクロールさせる */
.modal-content .lp-hero-candidates__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* モーダル内でタイトル・アクションは固定表示（縮まない） */
.modal-content .lp-hero-candidates__title,
.modal-content .lp-hero-candidates__actions {
  flex-shrink: 0;
}

.lp-hero-candidates__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.lp-hero-candidates__item {
  padding: var(--spacing-sm);
  background: #fff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lp-hero-candidates__item:hover {
  border-color: var(--primary, #2563eb);
}

.lp-hero-candidates__item--selected {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.lp-hero-candidates__preview {
  margin-bottom: var(--spacing-sm);
}

/* ヒーロープレビュー（LPテンプレート .fvWrap と同じスタイル。コンテナ幅ベースでスケール）
   CSS変数（--css_themeColor 等）は JS の renderHeroCandidatesList でフォーム入力値からインライン注入される */
.lp-hero-candidates__hero {
  container-type: inline-size;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}

.lp-hero-candidates__hero p.subCatchcopy {
  margin: 9px 0 0;
  padding: 9px;
  font-size: clamp(15px, calc(100cqw * 15 / 769), 22px);
  font-weight: 700;
  line-height: 1.5em;
  text-align: center;
}

.lp-hero-candidates__hero p.upperCatchcopy {
  display: inline-block;
  padding: 0.18em 0.45em;
  text-align: center;
  width: 100%;
  margin: 5px 0;
  font-size: clamp(18px, calc(100cqw * 19 / 769), 27px);
  font-weight: 700;
}

.lp-hero-candidates__hero .catchcopy {
  font-size: calc(clamp(22px, calc(100cqw * 22 / 769), 37px) * var(--catchcopy-scale, 1));
  font-weight: 900;
  line-height: 1.3em;
  margin: 5px 0;
  padding: 9px 0 18px;
  text-align: center;
}

.lp-hero-candidates__hero .catchcopy span.thinTxt {
  font-size: 0.8em;
  font-weight: 700;
}

.lp-hero-candidates__hero .catchcopy span.blueBack {
  font-size: inherit;
  display: inline-block;
  line-height: 1.15;
  padding: 0.12em 0.28em;
  background: var(--css_themeColor);
  color: var(--css_invertedTextColor);
}

.lp-hero-candidates__hero .catchcopy span.underline {
  font-size: inherit;
  letter-spacing: 0.09em;
  display: inline;
  line-height: 1.15;
  padding: 0 0.05em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.lp-hero-candidates__hero span.underline {
  background: linear-gradient(transparent 60%, var(--css_fvHighlightColor) 30%);
  display: inline;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.lp-hero-candidates__hero p {
  font-size: clamp(11px, calc(100cqw * 11 / 769), 16px);
  margin: 12px 0 0;
  line-height: 1.5em;
}

.lp-hero-candidates__pre,
.lp-hero-candidates__main,
.lp-hero-candidates__sub {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.lp-hero-candidates__main {
  font-weight: 600;
}

.lp-hero-candidates__sub {
  color: var(--text-secondary, #64748b);
}

.lp-hero-candidates__btn {
  margin-top: 4px;
}

.lp-hero-candidates__btn--selected {
  background: var(--primary, #2563eb);
  color: #fff;
  border-color: var(--primary, #2563eb);
  cursor: default;
}

.lp-hero-candidates__abort,
.lp-hero-candidates__continue {
  margin-top: 0;
}

@media (max-width: 768px) {
  .lp-hero-candidates__list {
    grid-template-columns: 1fr;
  }
  .lp-hero-candidates__hero {
    padding: 14px;
  }
}

.ai-context-selector .button {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
}

/* ========================================
   ステップバー & コンテナ
   ======================================== */
.step-bar-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 2rem auto;
  max-width: 800px;
}

.step-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 80px;
  color: var(--gray-400);
}

/* form.css の .step-number { min-width: 60px } と競合するため、正円を維持するために明示 */
.step-bar-item .step-number {
  width: 40px;
  height: 40px;
  min-width: 40px;
  max-width: 40px;
  line-height: 40px;
  border-radius: 50%;
  background-color: var(--gray-400);
  color: var(--white);
  font-weight: bold;
  margin-bottom: 0.5rem;
  transition: background-color 0.3s;
}

.step-bar-item .step-name {
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
}

.step-bar-item.active {
  color: var(--text-primary);
  font-weight: bold;
}

.step-bar-item.active .step-number {
  background-color: var(--info-link);
}

.step-bar-connector {
  flex-grow: 1;
  height: 2px;
  background-color: var(--gray-400);
  margin: 20px 0;
}

.step-container {
  display: none;
  padding: 2rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-top: 1rem;
  background: var(--white) fff;
  box-shadow: 0 4px 12px var(--black-05);
  scroll-margin-top: 2rem;
}

.step-container.active {
  display: block;
}

/* ステップヘッダー（見出し＋ボタン）と次のブロックの間の余白 */
.step-header-with-action {
  margin-bottom: var(--spacing-md);
}

/* ステップ4：5ステップ下メニュー（固定表示・スクロール連動） */
.header-process-nav-wrapper {
  position: sticky;
  top: 60px;
  z-index: 100;
  background: var(--white);
  box-shadow: 0 2px 8px var(--black-10);
  margin-bottom: 0.5rem;
}

.header-process-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  margin: 0;
  list-style: none;
}

.header-process-nav a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.header-process-nav a:hover {
  background: var(--secondary-light);
  color: var(--text-primary);
}

.header-process-nav a.active {
  background: var(--info-link);
  color: var(--white);
}

.header-process-nav .item-count {
  font-size: 0.75rem;
  font-weight: normal;
  opacity: 0.8;
  margin-left: 0.25rem;
}

/* ========================================
   見出し・サブヘッドライン
   ======================================== */
h2 {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  padding: 0;
  background: none;
  border: none;
  cursor: default;
}

h2:hover {
  background: none;
  color: var(--text-primary);
}

h3.sub-headline {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--info-link);
}

h3.sub-headline:first-of-type {
  margin-top: 1rem;
}

/* ステップ3：作業手順1〜4の見出し（背景オーバーレイで区切りを明確に） */
.work-step-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.75rem;
  margin-bottom: 0;
  padding: 0.75rem 1rem;
  background-color: var(--gray-100);
  border-left: 4px solid var(--theme-navy);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 1px 2px var(--black-05);
}

.work-step-title:first-of-type {
  margin-top: 1rem;
}

/* 作業手順内の子見出し・説明文（子見出し → 説明文 → ボタン の構成用） */
.work-step-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.25rem 0 0.35rem;
}
.work-step-subtitle:first-child {
  margin-top: 0;
}
.work-step-desc {
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* 見出し直後のコンテンツとの余白 */
.step-container .work-step-title + .form-section,
.step-container .work-step-title + .action-buttons-container,
.step-container .work-step-title + .competitor-url-grid,
.step-container .work-step-title + .competitor-rows-wrapper,
.step-container .work-step-title + .accordion,
.step-container .work-step-title + .work-step-subtitle {
  margin-top: 1rem;
}

/* ========================================
   フォームアクション・ボタンコンテナ
   ======================================== */
.form-actions,
.action-buttons-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

/* ========================================
   モーダルウィンドウ
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-bg);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: calc(60px + 1rem) 0 2rem 0;
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  background-color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* ========================================
   チュートリアル（コールアウト方式）
   - 暗転マスクは使わず、ターゲット付近のコールアウトで案内する
   - tutorial 中は固定ヘッダーを下げ、コールアウトが隠れないようにする
   ======================================== */
body.tutorial-active .site-header {
  z-index: var(--z-sticky);
}

body.tutorial-active .lp-editor-fixed-header {
  z-index: var(--z-sticky);
}

.tutorial-callout {
  position: fixed;
  max-width: min(480px, calc(100vw - 2rem));
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast); /* 画面上の通常UIより手前（トーストは 99999 で別途最前面） */
  pointer-events: auto;
}
@media (max-width: 768px) {
  .tutorial-callout {
    max-width: calc(
      100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) -
        1rem
    );
  }
}
.tutorial-callout__panel {
  padding: 1rem 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}
.tutorial-callout__meta {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.5rem;
}
.tutorial-callout__step {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.55em;
  border-radius: 9999px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  color: var(--secondary-color);
  font-size: 0.75rem;
  line-height: 1;
}
.tutorial-callout__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}
.tutorial-callout__description {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-primary);
}
.tutorial-callout__help {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.875rem 1rem;
  margin: 0 0 1rem;
}
.tutorial-callout__help-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
}
.tutorial-callout__help-text strong {
  color: var(--theme-navy);
  font-weight: 600;
}
.tutorial-callout__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.tutorial-callout__disabled-action {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}
.tutorial-callout__skip {
  margin-left: auto;
}

.tutorial-callout__arrow {
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
}
.tutorial-callout__arrow::before,
.tutorial-callout__arrow::after {
  content: "";
  position: absolute;
  left: 0;
  width: 0;
  height: 0;
  transform: translateX(-50%);
}

/* 付け根（枠色） */
.tutorial-callout[data-placement="top"] .tutorial-callout__arrow {
  bottom: -12px;
  animation: tutorialCalloutArrowBounceDown 1.1s ease-in-out infinite;
}
.tutorial-callout[data-placement="top"] .tutorial-callout__arrow::before {
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid var(--gray-200);
  top: 0;
}
.tutorial-callout[data-placement="top"] .tutorial-callout__arrow::after {
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 11px solid var(--white);
  top: 1px;
}

.tutorial-callout[data-placement="bottom"] .tutorial-callout__arrow {
  top: -12px;
  animation: tutorialCalloutArrowBounceUp 1.1s ease-in-out infinite;
}
.tutorial-callout[data-placement="bottom"] .tutorial-callout__arrow::before {
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 12px solid var(--gray-200);
  top: 0;
}
.tutorial-callout[data-placement="bottom"] .tutorial-callout__arrow::after {
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 11px solid var(--white);
  top: 1px;
}

.tutorial-callout[data-placement="center"] .tutorial-callout__arrow {
  display: none;
}

@keyframes tutorialCalloutArrowBounceDown {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(4px);
  }
}
@keyframes tutorialCalloutArrowBounceUp {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-4px);
  }
}

.tutorial-target--highlight {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.6);
  border-radius: 6px;
}

/* ========================================
   スピナー・アニメーション
   ======================================== */
.spinner {
  border: 2px solid var(--gray-100);
  border-top: 2px solid var(--gray-500);
  border-radius: 50%;
  width: 1em;
  height: 1em;
  animation: spin 1s linear infinite;
  display: inline-block;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes sparkle {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(180deg);
  }
}

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

/* ========================================
   アラート・成功メッセージ
   ======================================== */
.alert-success {
  background-color: var(--alert-success-bg);
  color: var(--alert-success-text);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--alert-success-border);
  border-radius: 0.25rem;
}

/* ========================================
   比較テーブル
   ======================================== */
.table-wrapper,
.table-preview-wrapper {
  margin-top: 1rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  border: 1px solid var(--gray-300);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

.comparison-table th {
  background-color: var(--secondary-light);
  font-weight: bold;
}

.comparison-table tbody tr:nth-child(odd) {
  background-color: var(--white);
}

.table-preview .comparison-table {
  font-size: 0.8rem;
}

/* テーブルラッパー：横に長いテーブルはラッパー内で横スクロール（10列並ぶ箇所など） */
.table-wrapper {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* サービス開発エディタ：このページ内のみ余白を小さめに（俯瞰しやすくする） */
.service-dev-editor .form-section {
  margin-bottom: 1rem;
}
.service-dev-editor .table-wrapper {
  margin-top: 0.75rem;
}
.service-dev-editor .comparison-table th,
.service-dev-editor .comparison-table td {
  padding: 0.5rem;
}

/* 比較表（AIによる競合比較表）：列幅を広めに固定し、横スクロール可能 */
#comparison-table-wrapper {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
#comparison-table-wrapper .comparison-table {
  table-layout: fixed;
  width: 1860px;
  min-width: 100%;
}
#comparison-table-wrapper .comparison-table th:first-child,
#comparison-table-wrapper .comparison-table td:first-child {
  width: 80px;
  min-width: 80px;
  position: sticky;
  left: 0;
  z-index: 1;
  background-color: var(--secondary-light);
  box-shadow: 2px 0 4px var(--black-05);
}
#comparison-table-wrapper .comparison-table td:first-child {
  background-color: var(--white);
}
#comparison-table-wrapper
  .comparison-table
  tbody
  tr:nth-child(odd)
  td:first-child {
  background-color: var(--white);
}
#comparison-table-wrapper
  .comparison-table
  tbody
  tr:nth-child(even)
  td:first-child {
  background-color: var(--gray-50);
}
#comparison-table-wrapper .comparison-table th:not(:first-child),
#comparison-table-wrapper .comparison-table td:not(:first-child) {
  width: 178px;
  min-width: 178px;
}

/* スマホ表示：比較表の固定幅を約1/3に縮小（スクロール量を軽減） */
@media (max-width: 768px) {
  #comparison-table-wrapper .comparison-table {
    width: 620px; /* 1860px の約1/3 */
  }
  #comparison-table-wrapper .comparison-table th:first-child,
  #comparison-table-wrapper .comparison-table td:first-child {
    width: 52px;
    min-width: 52px;
  }
  #comparison-table-wrapper .comparison-table th:not(:first-child),
  #comparison-table-wrapper .comparison-table td:not(:first-child) {
    width: 52px;
    min-width: 52px;
  }
  #comparison-table-wrapper .comparison-table th,
  #comparison-table-wrapper .comparison-table td {
    padding: 0.4rem;
    font-size: 0.85rem;
  }
}

/* 競合URL入力：2列グリッド・コンパクト（サービス開発エディタ内） */
.competitor-url-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 100%;
  margin-bottom: 1rem;
}
.competitor-url-cell {
  min-width: 0;
  margin-bottom: 0;
}
.competitor-url-cell .form-input {
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .competitor-url-grid {
    grid-template-columns: 1fr;
  }
}

/* 競合分析：1行3要素（URL｜取得元テキスト｜サイト情報分析）×10行 */
.competitor-rows-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  max-width: 100%;
}

.competitor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1fr 1fr;
  gap: 0.75rem 1rem;
  align-items: start;
  min-width: 0;
}

.competitor-row-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.competitor-row-col .form-label {
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.competitor-row-col .form-input,
.competitor-row-col .form-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 作業手順3：表示欄の縦幅を5行程度で揃える */
.competitor-row-col .form-textarea.competitor-row-textarea {
  min-height: 8.5rem;
  resize: vertical;
}
.competitor-row-col .form-textarea:not(.competitor-row-textarea) {
  min-height: 6em;
  resize: vertical;
}
/* 作業手順3の入力欄：スクロールバーを非表示（スクロールは可能） */
.competitor-rows-wrapper .form-textarea {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.competitor-rows-wrapper .form-textarea::-webkit-scrollbar {
  display: none;
}

@media (max-width: 768px) {
  .competitor-row {
    grid-template-columns: 1fr;
  }
}

/* SERP結果テーブル：画面幅ははみ出さず、ラッパー内で横スクロール可能にする
   - スマホ（特にSafari）では table-cell の overflow が効かず、長いURLで表自体が右にはみ出すことがあるため
   - 表全体をスクロールコンテナで受け、ビューポート外には出さない */
#serpapi-ads-table-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.serpapi-ads-table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}
/* 列幅を％で指定して表が画面幅をはみ出さないようにする（順位・種別・タイトル・表示URL・リンクURL・ドメイン・スニペット） */
.serpapi-ads-table th:nth-child(1),
.serpapi-ads-table td:nth-child(1) {
  width: 5%;
}
.serpapi-ads-table th:nth-child(2),
.serpapi-ads-table td:nth-child(2) {
  width: 8%;
}
.serpapi-ads-table th:nth-child(3),
.serpapi-ads-table td:nth-child(3) {
  width: 16%;
}
.serpapi-ads-table th:nth-child(4),
.serpapi-ads-table td:nth-child(4) {
  width: 14%;
}
.serpapi-ads-table th:nth-child(5),
.serpapi-ads-table td:nth-child(5) {
  width: 18%;
}
.serpapi-ads-table th:nth-child(6),
.serpapi-ads-table td:nth-child(6) {
  width: 11%;
}
.serpapi-ads-table th:nth-child(7),
.serpapi-ads-table td:nth-child(7) {
  width: 28%;
}

.serpapi-ads-table th,
.serpapi-ads-table td {
  max-height: 6em;
  overflow: auto;
  vertical-align: top;
  word-break: break-all;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.serpapi-ads-table th::-webkit-scrollbar,
.serpapi-ads-table td::-webkit-scrollbar {
  display: none;
}
/* リンクURL列：折り返さずセル内で横スクロール */
.serpapi-ads-table td:nth-child(5) {
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: auto;
  word-break: normal;
}
.serpapi-ads-table .serp-link-url {
  color: var(--theme-navy);
  text-decoration: underline;
  white-space: nowrap;
}
.serpapi-ads-table .serp-link-url:hover {
  text-decoration: none;
}

/* 競合分析結果（取得元テキスト・サイト情報）2列表示 */
.competitor-results-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
  max-width: 100%;
}

.competitor-result-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.competitor-result-column .form-label {
  margin-bottom: 0.5rem;
  font-weight: bold;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.competitor-result-column .form-textarea {
  flex: 1;
  min-height: 200px;
  resize: vertical;
}

/* ========================================
   アコーディオンUI
   ======================================== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.accordion-item {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}

.accordion-item {
  scroll-margin-top: 2rem;
}

.accordion-header {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--info-link);
  border: none;
  text-align: left;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-header:hover {
  background: var(--info-link-hover);
}

.accordion-header.active {
  background: var(--info-link);
  color: var(--white);
}

.accordion-header::after {
  content: "▲";
  transition: transform 0.3s;
}

.accordion-header.closed::after {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: none;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 1.5rem;
}

.accordion-content.closed {
  max-height: 0;
  padding: 0 1.5rem;
}

/* ツールチップ表示時はアコーディオン枠でクリップされないよう overflow を解除（開いているときのみ） */
.accordion-item:has(.accordion-content:not(.closed) .c-help-tooltip:hover),
.accordion-item:has(.accordion-content:not(.closed) .c-help-tooltip--visible),
.accordion-item:has(.accordion-content:not(.closed) .c-help-tooltip--open) {
  overflow: visible;
}
.accordion-content:has(.c-help-tooltip:hover):not(.closed),
.accordion-content:has(.c-help-tooltip--visible):not(.closed),
.accordion-content:has(.c-help-tooltip--open):not(.closed) {
  overflow: visible;
}

/* ========================================
   プレビュー制御（LP・Thanks エディタ共通）
   ======================================== */
.preview-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.preview-controls .button {
  flex: 1;
  min-width: 120px;
}

/* ========================================
   レスポンシブ対応
   ======================================== */
@media (max-width: 1024px) {
  .header__inner {
    gap: 1rem;
  }

  .header__ai-pill {
    font-size: 0.55rem;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 0;
  }

  .header__inner {
    height: 60px;
    gap: 0.5rem;
    margin: 0 1rem;
    width: calc(100% - 2rem);
  }

  .header__left {
    gap: 1.25rem;
  }

  .header__left .logo-text {
    display: none;
  }

  /* ログイン済み時のみ主ナビを非表示（未ログイン時はハンバーガーが出ないため主ナビを残す） */
  body[data-ai-remaining] .header__main-nav {
    display: none;
  }

  .header__main-nav a {
    padding: 0.3rem 0.4rem;
    font-size: 0.85rem;
  }

  /* パネル内主ナビ（ハンバーガー開時・768px 以下で表示） */
  .header__menu-nav {
    padding: 0.5rem 0 0;
  }

  .header__menu-nav .header__menu-item {
    display: block;
  }

  .header__utility {
    gap: 1rem;
  }

  .header__pill {
    padding: 0 0.75rem;
    font-size: 0.85rem;
  }

  .header__pill span {
    display: inline;
  }

  .header__account-name {
    display: none;
  }

  .header__account-avatar {
    width: 28px;
    height: 28px;
  }

  .header__ai-pill {
    font-size: 0.55rem;
  }

  .logo {
    gap: 0.75rem;
  }

  .logo-icon {
    height: 32px;
    max-width: 180px;
  }

  .logo-main {
    font-size: 1.4rem;
  }

  /* LP・Thanks エディタ: 縦積み・タブ切り替え・プレビュー高さ確保 */
  .editor-container {
    flex-direction: column;
    height: calc(100vh - 61px);
    min-height: calc(100vh - 61px);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
  }

  /* 編集タブ選択時: body スクロール化（右端縦帯解消）。コンテナはコンテンツ高に合わせる */
  .editor-container[data-active-tab="editor"] {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  /* 768px 以下: タブは固定ヘッダー内（文言設定ドロップダウンの上）に配置されるため sticky 不要 */
  .editor-tabs {
    display: flex;
    flex-shrink: 0;
    gap: 0;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid var(--gray-300);
    background: var(--white);
  }

  .editor-tabs__tab {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-base, 14px);
    font-weight: 500;
    color: var(--text-primary);
    background: var(--gray-100);
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition:
      background 0.2s ease,
      border-color 0.2s ease;
  }

  .editor-tabs__tab:hover {
    background: var(--gray-200);
  }

  .editor-tabs__tab--active {
    background: var(--white);
    border-bottom-color: var(--theme-navy);
    color: var(--theme-navy);
  }

  .editor-container[data-active-tab="preview"] .editor-panel {
    display: none;
  }

  .editor-container[data-active-tab="editor"] .preview-panel {
    display: none;
  }

  /* 編集タブ選択時: パネルはコンテンツ高まで伸ばし、body でスクロール（右端縦帯解消） */
  .editor-container[data-active-tab="editor"] .editor-panel {
    overflow-y: visible;
    min-height: auto;
  }

  /* 編集タブ選択時もパネルを画面下まで伸ばし、中身だけスクロール（右端余白は scrollbar-gutter: auto で常時確保しない） */
  .editor-panel {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 1rem;
    overflow-y: auto;
    scrollbar-gutter: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* プレビュータブ選択時はパネルをビューポートいっぱいに伸ばし、縦幅不足・右余白を防ぐ */
  .preview-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
  }

  .preview-window-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.75rem;
    overflow: auto;
    scrollbar-gutter: auto;
    -webkit-overflow-scrolling: touch;
  }

  .category-panel {
    padding: 1rem;
  }

  /* 編集タブ選択時: コンテンツ最上部のカテゴリ選択（文言設定等） */
  .editor-panel .category-selector--editor-top {
    width: 100%;
    padding: 0 0 1rem;
    margin-bottom: 0;
    box-sizing: border-box;
  }

  .editor-panel .category-selector--editor-top .category-dropdown {
    min-width: 0;
  }

  .ai-context-selector {
    padding: 1rem;
  }

  .color-input-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .form-color {
    width: 100%;
    height: 50px;
  }

  .color-text-input {
    max-width: none;
  }

  .preview-controls {
    flex-direction: column;
  }

  .preview-controls .button {
    flex: none;
  }

  /* サービス開発エディタ（ステップ3）モバイル */
  .competitor-results-container {
    grid-template-columns: 1fr;
  }

  .competitor-result-column {
    min-width: 0;
    width: 100%;
  }

  .competitor-result-column .form-section {
    padding: 0.75rem;
    margin-bottom: 1rem;
  }

  .competitor-result-column .form-label-container {
    margin-bottom: 0.25rem;
  }

  /* .table-wrapper の overflow-x は共通で指定済みのためここでは省略 */

  .comparison-table {
    min-width: 600px;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem;
  }

  .step-bar-container {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
  }

  .step-bar-item {
    width: 56px;
    flex-shrink: 0;
  }

  .step-bar-item .step-name {
    font-size: 0.7rem;
  }

  .step-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0;
  }

  .header__inner {
    height: 56px;
    margin: 0 0.5rem;
    width: calc(100% - 1rem);
  }

  /* ログイン済み時のみ主ナビを非表示（768px と統一） */
  body[data-ai-remaining] .header__main-nav {
    display: none;
  }

  .header__pill span {
    display: none;
  }

  .header__pill[aria-label="管理画面"] span {
    display: none;
  }

  /* スマホでもAI残数は表示する（以前は .usage-line2 を display:none で非表示にしていた） */
  .header__ai-pill {
    font-size: 0.55rem;
  }

  .logo {
    gap: 0.5rem;
  }

  .logo-icon {
    height: 28px;
    max-width: 160px;
  }

  .logo-main {
    font-size: 1.3rem;
  }

  .header__account-avatar {
    width: 24px;
    height: 24px;
  }

  /* サービス開発エディタ（ステップ3）モバイル */
  .step-container {
    padding: 0.75rem;
  }

  /* LP・Thanks エディタ: 480px 時の余白縮小 */
  .editor-panel {
    padding: 0.75rem;
  }

  .preview-window-wrapper {
    padding: 0.5rem;
  }

  .action-buttons-container.single-button .button {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   キャンペーン削除機能のスタイル（共通スタイルに統合済み）
   ======================================== */

.button-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.25rem;
}

.delete-confirmation {
  background-color: var(--secondary-light);
  border: 1px solid var(--gray-200);
  border-radius: 0.375rem;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
}

.warning-text {
  color: var(--danger-color);
  font-size: 0.875rem;
  margin: 1rem 0;
  font-weight: 500;
}

/* モーダルのスタイル（既存のモーダルスタイルと統合） */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--black-50);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: calc(60px + 1rem) 0 2rem 0;
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  background: var(--white);
  border-radius: 0.5rem;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 25px var(--black-20);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary-color);
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--secondary-dark);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.form-actions .button {
  min-width: 100px;
}

/* アラートメッセージのスタイル */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
}

.alert-success {
  background-color: var(--alert-success-bg);
  border-color: var(--alert-success-border);
  color: var(--alert-success-text);
}

.alert-error {
  background-color: var(--alert-error-bg);
  border-color: var(--alert-error-border);
  color: var(--alert-error-text);
}

/* ========================================
   トースト通知システム
   レイアウト・z-index は CSS で一元管理（JS のインラインは最小限）。
   トーストは常に最前面（z-index: 99999）。他 UI との重なり順は以下を参照。
   ======================================== */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 6px;
  color: var(--white);
  font-weight: 500;
  z-index: 99999;
  animation: slideInRight 0.3s ease-out;
  max-width: 300px;
  word-wrap: break-word;
  box-shadow: 0 4px 12px var(--black-15);
}

/* LP/Thanks 編集画面: 2 段ヘッダー（.site-header + .lp-editor-fixed-header）の下に表示し被りを防ぐ */
body:has(main.main-container--editor) .toast-notification {
  top: calc(env(safe-area-inset-top, 0px) + 60px + 90px + 12px);
  right: max(12px, env(safe-area-inset-right, 0px));
}
@media (max-width: 480px) {
  body:has(main.main-container--editor) .toast-notification {
    top: calc(env(safe-area-inset-top, 0px) + 56px + 88px + 12px);
  }
}

.toast-success {
  background-color: var(--success-color);
}

.toast-error {
  background-color: var(--danger-color);
}

.toast-warning {
  background-color: var(--warning-color);
  color: var(--gray-900);
}

.toast-info {
  background-color: var(--info-color);
}

/* トースト通知のアニメーション */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ========================================
   メール履歴モーダル
   ======================================== */
.modal-large {
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.history-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-lighter);
}

.history-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary-color);
}

.history-tab:hover {
  color: var(--info-link);
  background-color: var(--secondary-light);
}

.history-tab.active {
  border-bottom-color: var(--info-link);
  color: var(--info-link);
  background-color: var(--secondary-light);
}

.history-panel {
  display: none;
}

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

.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.history-table th {
  background-color: var(--secondary-light);
  font-weight: 600;
  color: var(--secondary-dark);
  border-bottom: 2px solid var(--gray-200);
}

.history-table th,
.history-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}

.history-table tbody tr {
  transition: background-color 0.15s ease;
}

.history-table tbody tr:hover {
  background-color: var(--gray-100);
}

.schedule-input {
  padding: 4px 8px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  max-width: 200px;
}

.schedule-input:focus {
  outline: none;
  border-color: var(--info-link);
  box-shadow: 0 0 0 2px rgba(var(--info-link-rgb), 0.25);
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  min-width: 60px;
}

.status-sent {
  background-color: var(--alert-success-bg);
  color: var(--alert-success-text);
}

.status-failed {
  background-color: var(--alert-error-bg);
  color: var(--alert-error-text);
}

.status-pending {
  background-color: var(--white) 3cd;
  color: var(--alert-warning-text);
}

.status-cancelled {
  background-color: var(--gray-200);
  color: var(--gray-700);
}

.button-sm {
  padding: 4px 8px;
  font-size: 12px;
  margin-right: 4px;
}

.button-sm:last-child {
  margin-right: 0;
}

.step-intro-browser-btn,
.step-intro-browser-btn:hover {
  text-decoration: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .modal-large {
    width: 95%;
    max-height: min(90vh, calc(100vh - 140px));
  }

  .history-table {
    font-size: 14px;
  }

  .history-table th,
  .history-table td {
    padding: 8px;
  }

  .schedule-input {
    max-width: 150px;
  }

  .button-sm {
    padding: 2px 6px;
    font-size: 11px;
  }
}

/* ========================================
   ボタン個別スタイル
   ======================================== */
#js-s4-bulk-generate-button {
  margin: 5px;
}

/* ========================================
   戦略レビュー表示スタイル
   ======================================== */
.strategy-review-display {
  background: var(--white) fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 24px;
  margin-top: 16px;
  box-shadow: 0 2px 4px var(--black-10);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans",
    "Noto Sans CJK JP", "Original Yu Gothic", "Yu Gothic", sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
}

.strategy-review-display h1 {
  color: var(--gray-800);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 24px 0;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--info-color);
}

.strategy-review-display h2 {
  color: var(--gray-700);
  font-size: 22px;
  font-weight: 600;
  margin: 16px 0 16px 0;
  padding-left: 12px;
  border-left: 4px solid var(--info-color);
  background: linear-gradient(
    90deg,
    rgba(var(--info-color-rgb), 0.1) 0%,
    transparent 100%
  );
  padding: 12px 0 12px 16px;
}

.strategy-review-display h3 {
  color: var(--gray-800);
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px 0;
  padding-left: 8px;
  border-left: 3px solid var(--danger-color);
}

.strategy-review-display h4 {
  color: var(--gray-700);
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 10px 0;
  padding-left: 6px;
  border-left: 2px solid var(--warning-color);
}

.strategy-review-display p {
  margin: 0 0 16px 0;
  text-align: justify;
}

.strategy-review-display ul,
.strategy-review-display ol {
  margin: 16px 0;
  padding-left: 24px;
}

.strategy-review-display li {
  margin: 8px 0;
  position: relative;
}

.strategy-review-display ul li::marker {
  color: var(--info-color);
  font-weight: bold;
}

.strategy-review-display ol li::marker {
  color: var(--danger-color);
  font-weight: bold;
}

.strategy-review-display strong {
  color: var(--gray-800);
  font-weight: 600;
  background: linear-gradient(
    120deg,
    rgba(var(--info-color-rgb), 0.2) 0%,
    transparent 100%
  );
  padding: 2px 4px;
  border-radius: 3px;
}

.strategy-review-display em {
  color: var(--gray-500);
  font-style: italic;
}

.strategy-review-display blockquote {
  border-left: 4px solid var(--info-color);
  background: var(--secondary-light);
  margin: 20px 0;
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.strategy-review-display hr {
  border: none;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--info-color) 0%,
    var(--danger-color) 50%,
    var(--warning-color) 100%
  );
  margin: 32px 0;
  border-radius: 1px;
}

.strategy-review-display code {
  background: var(--gray-100);
  color: var(--danger-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.9em;
}

.strategy-review-display pre {
  background: var(--gray-800);
  color: var(--gray-100);
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--gray-700);
}

.strategy-review-display pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* 戦略レビューのセクション（シンプルな装飾） */
.strategy-review-display .evaluation-section,
.strategy-review-display .advantage-section,
.strategy-review-display .improvement-section,
.strategy-review-display .opportunity-section,
.strategy-review-display .action-section {
  background: var(--gray-100);
  color: var(--text-primary);
  padding: 20px;
  border-radius: 8px;
  margin: 24px 0;
  border-left: 4px solid var(--info-color);
}

.strategy-review-display .evaluation-section,
.strategy-review-display .advantage-section,
.strategy-review-display .improvement-section,
.strategy-review-display .opportunity-section {
  border-left: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .strategy-review-display {
    padding: 16px;
    margin-top: 12px;
  }

  .strategy-review-display h1 {
    font-size: 24px;
  }

  .strategy-review-display h2 {
    font-size: 20px;
    padding: 10px 0 10px 12px;
  }

  .strategy-review-display h3 {
    font-size: 16px;
  }

  .strategy-review-display ul,
  .strategy-review-display ol {
    padding-left: 20px;
  }
}

/* 問合せ詳細（design-system 変数のみ使用） */
.inquiry-detail-content {
  margin-top: 1.5rem;
}

.inquiry-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.inquiry-detail-list dt {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.inquiry-detail-list dt:first-child {
  margin-top: 0;
}

.inquiry-detail-list dd {
  margin: 0;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-lighter);
  color: var(--text-primary);
}

.inquiry-detail-list dd:last-child {
  border-bottom: none;
}

.document-table-row-link {
  color: var(--theme-teal);
  text-decoration: none;
}

.document-table-row-link:hover {
  text-decoration: underline;
}

/* 問合せ詳細：メール送信履歴 */
.inquiry-mail-history {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-lighter);
}

.inquiry-mail-history-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.inquiry-mail-history-block {
  margin-bottom: 1.5rem;
}

.inquiry-mail-history-block:last-child {
  margin-bottom: 0;
}

.inquiry-mail-history-subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.inquiry-mail-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.inquiry-mail-history-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-lighter);
  font-size: 0.875rem;
  color: var(--text-primary);
}

.inquiry-mail-history-item:last-child {
  border-bottom: none;
}

.inquiry-mail-status {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.inquiry-mail-status-sent {
  background: var(--success-bg, #e8f5e9);
  color: var(--success-fg, #2e7d32);
}

.inquiry-mail-status-failed {
  background: var(--danger-bg, #ffebee);
  color: var(--danger-fg, #c62828);
}

.inquiry-mail-status-pending {
  background: var(--border-lighter);
  color: var(--text-secondary);
}

.inquiry-mail-response-code {
  margin-right: 0.5rem;
  color: var(--text-secondary);
}

.inquiry-mail-meta {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-secondary);
}

.inquiry-mail-error {
  display: block;
  margin-top: 0.25rem;
  color: var(--danger-fg, #c62828);
  font-size: 0.8125rem;
}
