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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #F0F0F1;
  margin: 0;
  padding: 0;
}

.container {
  margin: 0;
  background: white;
}

.content-section {
  padding: 20px;
  background: #fff;
}

/* Page Title Styling */
.content-section > h2:first-of-type,
.settings-container > h2:first-child,
#palette-sets-list-view > h2:first-of-type,
.main-section-title {
  margin-top: -20px;
  margin-left: -20px;
  margin-right: -20px;
  margin-bottom: 20px;
  font-size: 26px;
  color: #333;
  padding: 15px 20px 0;
  border-bottom: 1px solid #aaa;
}

/* Page Header with Description (H2 + description text in flexbox) */
.page-header-with-description {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 20px;
  margin-top: -20px;
  margin-left: -20px;
  margin-right: -20px;
  padding: 15px 20px 10px;
  background: #000;
}

.page-header-with-description .main-section-title {
  margin: 0;
  padding: 0;
  border-bottom: none;
  line-height: 1.6;
  color: #fff;
}

.page-header-with-description p {
  color: #fff;
  margin: 0;
  line-height: 1.2;
  font-size: 13px;
  padding-bottom: 6px;
}

.header {
  background: #1e3a5f;
  color: white;
  padding: 10px 30px;
  position: relative;
}

.header h1 {
  font-size: 28px;
  margin: 0;
  padding: 10px 0;
}

.header p {
  opacity: 0.9;
  font-size: 14px;
}

/* Vertical Sidebar Styling */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 210px;
  height: 100vh;
  background: #1e3a5f;
  color: white;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.sidebar-header {
  padding: 40px 20px;
}

.sidebar-title {
  color: white;
  text-decoration: none;
  font-size: 28px;
  line-height: 1.5;
  font-weight: bold;
  margin: 0;
  letter-spacing: 0.3em;
  text-shadow:
    6px 6px 0 #0e213a,
    7px 7px 0 #0e213a,
    8px 8px 0 #0e213a;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  color: white;
  text-decoration: none;
  transition: background 0.2s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-link i {
  width: 20px;
  text-align: center;
}

/* Adjust main content to accommodate sidebar */
.main-content {
  margin-left: 210px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  background: white;
}

.tab {
  padding: 15px 30px;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: #666;
  transition: all 0.3s;
  border-radius: 0;
}

.tab:hover {
  background: #f5f5f5;
  color: #333;
}

.tab.active {
  color: #1e3a5f;
  border-bottom: 2px solid #1e3a5f;
  background: white;
}

.content {
  padding: 30px 30px 80px 30px;
  background: white;
  min-height: calc(100vh - 200px);
}

.tab-content {
  display: none;
}

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

/* アフィリエイトリンク管理 - テーブル形式 */

/* ボタン基底クラス - 共通要素 */
.btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
  display: inline-block;
  text-decoration: none;
  text-align: center;
  line-height: 1.5;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

/* ボタンバリエーション - 色のみ */
.btn-primary {
  background: #1e3a5f;
  color: white;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-warning {
  background: #ff9800;
  color: white;
}

.btn-info {
  background: #2196f3;
  color: white;
}

/* 戻るボタン - 共通サイズ */
.btn-back {
  padding: 12px 24px;
  font-size: 15px;
  margin-top: 0;
}

/* 標準ボタンサイズ - 共通 */
.btn-standard {
  padding: 12px 24px;
  font-size: 15px;
}

/* 画像アップロードボタン */
.btn-upload-image {
  width: 100%;
  max-width: 350px;
  padding: 12px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background 0.2s;
}

.btn-upload-image:hover {
  background: #218838;
}

/* カラーピッカーを円形にするスタイル */
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

/* リアルタイムカラーピッカーの統一スタイル */
.realtime-color-picker {
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.realtime-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

.realtime-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.realtime-color-picker::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

/* カスタムカラーアイコンの統一スタイル（パレットアイコンのみ表示） */
.custom-color-icon {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.custom-color-icon i.fa-palette {
  background: linear-gradient(135deg, #e74c3c 0%, #f1c40f 40%, #3498db 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 32px !important;
}

/* カラーサークル選択状態の統一スタイル */
.color-circle.selected {
  border: 1px solid #333 !important;
}

/* カラーサークルラベルの統一スタイル */
.color-circle-label {
  cursor: pointer;
  position: relative;
}

/* マーカープリセットラベルの統一スタイル */
.marker-preset-label {
  cursor: pointer;
  position: relative;
}

/* カラーサークルの統一スタイル */
.color-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* チェックマークの統一スタイル */
.check-mark {
  font-size: 14px;
  pointer-events: none;
}

/* カラーピッカー説明ラベルの統一スタイル */
.color-picker-label {
  font-size: 11px;
  color: #666;
}

/* チェックボックスラベルテキストの統一スタイル */
.checkbox-label-text {
  font-size: 12px;
}

/* チェックボックス外側ラベルの統一スタイル */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  padding: 8px;
  cursor: pointer;
}

/* チェックボックスグループの統一スタイル */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* セクションナビゲーションボタンの統一スタイル */
.section-nav-btn {
  padding: 12px 15px;
  text-align: left;
  background: white;
  color: #666;
  border: none;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.section-nav-btn.active {
  background: #E0E0E0;
  color: #1e3a5f;
  border-bottom: 2px solid #1e3a5f;
  font-weight: bold;
}

.section-nav-btn.sub-section {
  background: white;
}

.section-nav-btn.sub-section.active {
  background: #E0E0E0;
  font-weight: bold;
}

/* 旧クラス名の互換性維持 */
.section-nav-button {
  padding: 12px 15px;
  text-align: left;
  background: #f5f5f5;
  color: #666;
  border: none;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

/* 設定セクションコンテナの統一スタイル */
.settings-section {
  background: white;
  border: 1px solid #ccc;
  border-radius: 0 8px 8px 0;
  padding: 15px;
  height: 100%;
}

/* セクション見出しの統一スタイル */
.section-heading {
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
  font-size: 18px;
  color: #1e3a5f;
}

/* カラーピッカー列コンテナの統一スタイル */
.color-picker-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* カラーピッカー本体の位置揃え */
.color-picker-column input[type="color"] {
  margin-top: 0;
  margin-bottom: 0;
}

/* カラーピッカーフィールドラベルの統一スタイル */
.color-picker-field-label {
  font-size: 12px;
  color: #333;
  font-weight: 500;
  height: 18px;
  line-height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* テキスト装飾のコントロール部分（左側）の統一幅 */
.text-decoration-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 150px;
}

/* テキスト装飾のサンプルプレビュー（右側） */
.text-decoration-preview {
  flex: 1;
  padding: 5px 10px;
  background: #fff;
  border-radius: 3px;
  font-size: 12px;
  text-align: center;
}

/* 設定パネル内の区切り線 */
.settings-divider {
  border-top: 1px solid #ddd;
  padding-top: 12px;
  margin-top: 12px;
}

/* H1を画像に重ねる関連設定（無効時） */
.h1-overlay-option {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* H1を画像に重ねる関連設定（有効時） */
.h1-overlay-option.enabled {
  opacity: 1;
  pointer-events: auto;
}

/* H1デザイン選択カードのスタイル */
.style-card {
  padding: 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  box-shadow: none;
  position: relative;
  overflow: visible;
}

.style-card:hover {
  background: #f0f0f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.style-card-name {
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
  font-weight: bold;
  text-align: center;
}

.style-card.selected {
  border: 3px solid #ffd700 !important;
  background: transparent !important;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3) !important;
}

.lp-title-link {
  display: block;
  width: 100%;
  padding: 0;
}

.lp-list tbody td:first-child:hover .lp-title-link {
  color: #d97757 !important;
}

#managed-lp-list tbody td {
  padding: 4px 12px;
}

.style-preview {
  background: #f9f9f9;
  padding: 10px;
  margin-bottom: 5px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.h1-sample {
  font-size: 24px;
  font-weight: bold;
}

.style-name {
  text-align: center;
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

/* H1デザインプレビュー用スタイル */
.h1-sample[data-style="h1-default"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  font-weight: bold;
}

.h1-sample[data-style="h1-bottom-solid"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  border-bottom: 3px solid currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-bottom-dotted"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  border-bottom: 3px dotted currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-left-solid"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  border-left: 4px solid currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-top-bottom-solid"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  border-top: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-box"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  border: 2px solid currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-corner-bracket"] {
  position: relative;
  margin-top: 0;
  margin-bottom: 0;
  padding: 1em 2em;
  text-align: center;
  font-weight: bold;
}

.h1-sample[data-style="h1-corner-bracket"]:before,
.h1-sample[data-style="h1-corner-bracket"]:after {
  position: absolute;
  content: '';
}

.h1-sample[data-style="h1-corner-bracket"]:after {
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.h1-sample[data-style="h1-corner-bracket"]:before {
  right: 0;
  bottom: 0;
  width: 30px;
  height: 30px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.h1-sample[data-style="h1-box-stripe"] {
  position: relative;
  margin-top: 0;
  margin-bottom: 0;
  padding: 1.5rem 1.5rem calc(1.5rem + 10px);
  border: 2px solid currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-box-stripe"]:after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10px;
  content: '';
  border-top: 2px solid currentColor;
  background-image: repeating-linear-gradient(-45deg, currentColor, currentColor 1px, transparent 2px, transparent 5px);
  background-size: 7px 7px;
}

/* コンバージョンページ管理 */
.cv-page-item {
  background: #e8e8e8;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 15px;
}

.cv-page-item h3 {
  margin-bottom: 15px;
  color: #333;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* デザイン設定 */
.design-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
}

.design-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.color-picker-group {
  display: grid;
  grid-template-columns: 150px 100px 1fr;
  gap: 10px;
  align-items: center;
}

.color-picker-group input[type="color"] {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

.color-picker-group input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.color-picker-group input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

.preview-box {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 20px;
  background: white;
}

.preview-box h3 {
  margin-bottom: 15px;
  color: #333;
}

.preview-button {
  display: inline-block;
  padding: 12px 24px;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  margin: 10px 10px 10px 0;
}

/* LP一覧アクションボタン */
.lp-actions-buttons {
  display: flex;
  gap: 15px;
  margin: 0 0 20px 0;
}
/* LP一覧 */
.lp-list {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.lp-list thead {
  background: #1e3a5f;
  color: white;
}

.lp-list th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.lp-list th:hover {
  background: #2c5282;
}

.lp-list th {
  position: relative;
  padding-right: 25px;
}

.lp-list th .sort-indicator {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.3;
}

.lp-list th .sort-indicator.active {
  opacity: 1;
}

.lp-list td {
  padding: 4px 12px;
  border-bottom: 1px solid #ddd;
  font-size: 14px;
  vertical-align: middle;
}

.lp-list tbody tr:hover {
  background: #f5f5f5;
}

.lp-list tbody tr:hover a {
  color: #ff8c00;
}

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

.btn-small {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.btn-edit {
  background: #667eea;
  color: white;
}

.btn-export {
  background: #17a2b8;
  color: white;
}

.btn-delete {
  background: #f44336;
  color: white;
}

.btn-small:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.success-message {
  background: #4caf50;
  color: white;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  display: none;
}

.success-message.show {
  display: block;
}

/* 新レイアウト：縦並びタブ */
.tabs {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 0;
  width: 150px;
}

.content {
  display: flex;
  gap: 20px;
}

.tabs-wrapper {
  width: 150px;
  flex-shrink: 0;
}

.content-wrapper {
  flex: 1;
}

.tab {
  text-align: left;
  border-radius: 6px;
  margin: 0;
}

/* contentEditable エディタ用 */
#lp-body-editor[contenteditable]:empty:before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}

#lp-body-editor:focus {
  outline: none;
}

/* プレースホルダー用スタイル */
.placeholder-highlight {
  color: #e74c3c;
  font-weight: 900;
  font-size: 1.1em;
}

/* 右パネル設定項目の統一スタイル */
.settings-field-group {
  margin-bottom: 12px;
}

.settings-label {
  display: block;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  height: 20px;
  line-height: 20px;
  margin-bottom: 10px;
}

.settings-input,
.settings-select {
  width: 50px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  background: white;
}

.settings-input-full {
  width: 100%;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  background: white;
}

.settings-select {
  width: 100%;
}

.settings-input-with-unit {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-unit-label {
  font-size: 12px;
  color: #666;
  margin-right: 2px;
}

.typography-item {
  flex: 0 0 80px;
}

/* 画像未選択時のグレーアウト */
.disabled-option {
  opacity: 0.5;
  transition: opacity 0.2s;
}


/* ========== 右下固定トグルボタン共通スタイル ========== */

/* トグルボタンに重ねて表示されるラベル */
.toggle-label {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: white;
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, 0.8),
    1px -1px 0 rgba(0, 0, 0, 0.8),
    -1px 1px 0 rgba(0, 0, 0, 0.8),
    1px 1px 0 rgba(0, 0, 0, 0.8),
    -2px 0 0 rgba(0, 0, 0, 0.8),
    2px 0 0 rgba(0, 0, 0, 0.8),
    0 -2px 0 rgba(0, 0, 0, 0.8),
    0 2px 0 rgba(0, 0, 0, 0.8);
  pointer-events: none;
}


/* ========== カスタムカラーパレット ========== */

/* パレット開閉トグルボタン（右下固定） */
.color-palette-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #667eea;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.color-palette-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  background: #5568d3;
}

.color-palette-toggle i {
  font-size: 24px;
  color: white;
}

/* パレットパネル（固定配置、右下） */
.color-palette-panel {
  position: fixed;
  bottom: 100px;
  right: 580px;
  width: 500px;
  max-height: none;
  background: white;
  border: 2px solid #667eea;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.color-palette-panel.active {
  display: flex;
}

/* パレットヘッダー */
.color-palette-header {
  background: #667eea;
  color: white;
  padding: 8px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.color-palette-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.color-palette-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 20px;
  line-height: 1;
}

.color-palette-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* パレットボディ */
.color-palette-body {
  padding: 10px;
  overflow-y: auto;
  height: 435px;
}

/* 色追加セクション */
.color-add-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.color-add-controls {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

.color-add-picker {
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-code-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: monospace;
  text-transform: uppercase;
}

.color-add-button {
  flex: 1;
  padding: 10px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.color-add-button:hover {
  background: #45a049;
}

/* パレットセット管理 */
.palette-set-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.palette-set-header {
  margin-bottom: 10px;
}

.palette-set-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
}

.palette-set-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.palette-set-name-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.palette-set-save-button {
  padding: 6px 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}

.palette-set-save-button:hover {
  background: #5568d3;
}

.palette-set-load-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.palette-set-select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

.palette-set-load-button {
  padding: 6px 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
  white-space: nowrap;
}

.palette-set-load-button:hover {
  background: #5568d3;
}

.palette-set-delete-button {
  padding: 6px 12px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.palette-set-delete-button:hover {
  background: #d32f2f;
}

/* カラーグリッド */
.color-palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  width: 100%;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

.color-palette-item {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  aspect-ratio: 1;
  cursor: pointer;
  border: 1px solid #ddd;
  transition: all 0.2s;
  box-sizing: border-box;
}

.color-palette-item:hover {
  border-color: #667eea;
  border-width: 2px;
  z-index: 1;
}

/* 固定プリセットはホバーエフェクトなし */
#fixed-color-palette-grid .color-palette-item:hover {
  border-color: #ddd;
  border-width: 1px;
  z-index: 0;
}

/* 各パレットグリッドを6列に固定 */
#system-color-palette-grid {
  grid-template-columns: repeat(6, 1fr) !important;
  grid-auto-columns: 1fr !important;
  grid-auto-rows: min-content !important;
  grid-auto-flow: row !important;
  align-items: start !important;
  max-height: none !important;
  overflow: hidden !important;
}

#user-color-palette-grid {
  grid-template-columns: repeat(6, 1fr) !important;
  grid-auto-columns: 1fr !important;
  grid-auto-rows: min-content !important;
  grid-auto-flow: row !important;
  align-items: start !important;
}

#fixed-color-palette-grid {
  grid-template-columns: repeat(6, 1fr) !important;
  grid-template-rows: repeat(4, 1fr) !important;
  grid-auto-columns: 1fr !important;
  grid-auto-rows: min-content !important;
  grid-auto-flow: row !important;
  align-items: start !important;
  max-height: none !important;
  overflow: hidden !important;
}

.color-palette-item-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: #f44336;
  color: white;
  border: 1.5px solid white;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  z-index: 2;
}

.color-palette-item:hover .color-palette-item-delete {
  display: flex;
}

.color-palette-item-delete:hover {
  background: #d32f2f;
}

/* 空状態メッセージ */
.color-palette-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}


/* ローディングスピナー */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ボックスデザインカードスタイル */
.box-design-card-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
}

.box-design-card-group .style-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ボックスデザインプレビュー */
.box-design-preview {
  font-size: 11px;
  list-style: none;
  padding: 8px;
  margin: 0;
}

.box-design-preview li {
  padding-left: 0;
  margin: 0;
}

/* 各デザインのプレビュースタイル */
.box-design-preview[data-design="bg-yellow"] {
  background-color: #fffacd;
  padding: 8px 12px;
}

.box-design-preview[data-design="offset-shadow"] {
  position: relative;
  z-index: 0;
  background: transparent;
  border: 2px solid #2589d0;
  padding: 8px 12px;
}

.box-design-preview[data-design="offset-shadow"]::after {
  content: '';
  background-color: var(--offset-shadow-bg-color, #fffacd);
  width: 100%;
  height: 100%;
  position: absolute;
  top: -5px;
  left: 5px;
  z-index: -1;
}

.box-design-preview[data-design="box-018"] {
  position: relative;
  padding: 8px 12px;
  border: none;
  border-top: 1px solid #2589d0;
  border-bottom: 1px solid #2589d0;
  background: transparent;
}

.box-design-preview[data-design="box-018"]::before,
.box-design-preview[data-design="box-018"]::after {
  content: '';
  position: absolute;
  width: 1px;
  top: 50%;
  transform: translateY(-50%);
  height: calc(100% + 8px);
  background-color: #2589d0;
}

.box-design-preview[data-design="box-018"]::before {
  left: 4px;
}

.box-design-preview[data-design="box-018"]::after {
  right: 4px;
}

.box-design-preview[data-design="box-design7"] {
  padding: 8px 12px;
  background-color: #f3f2f3;
  border: none;
}

.box-design-preview[data-design="box-design6"] {
  padding: 8px 12px;
  border: 1px solid #4c9ac0;
  position: relative;
  background: transparent;
}

.box-design-preview[data-design="box-design6"] li {
  background-image: linear-gradient(90deg, rgba(237, 119, 128, 0) 0%, rgba(237, 119, 128, 0) 50%, #fff 0%, #fff 100%), linear-gradient(180deg, rgba(237, 119, 128, 0) 0%, rgba(237, 119, 128, 0) 95%, #4c9ac0 100%);
  background-size: 4px 100%, 100% 1.2em;
  line-height: 1.2;
}

.box-design-preview[data-design="box-design11"] {
  padding: 8px 12px;
  background: #b2d3e4;
  box-shadow: 0 0 0 6px #b2d3e4;
  border: 1px dashed #fff;
}

.box-design-preview[data-design="box-003"] {
  padding: 8px 12px;
  box-shadow: 0 2px 2px rgb(0 0 0 / 5%);
  background-image: linear-gradient(transparent calc(100% - 1px), #e6edf3 50%, #e6edf3), linear-gradient(90deg, transparent calc(100% - 1px), #e6edf3 50%, #e6edf3);
  background-size: 8px 8px;
  background-repeat: repeat;
  background-color: #ffffff;
}


/* ===== Index.html specific styles =====
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


.container {
  margin: 0;
  background: white;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  background: white;
}

.tab {
  padding: 15px 30px;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: #666;
  transition: all 0.3s;
  border-radius: 0;
}

.tab:hover {
  background: #f5f5f5;
  color: #333;
}

.tab.active {
  color: #1e3a5f;
  border-bottom: 2px solid #1e3a5f;
  background: white;
}

.content {
  padding: 30px 30px 80px 30px;
  background: white;
  min-height: calc(100vh - 200px);
}

.tab-content {
  display: none;
}

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

/* アフィリエイトリンク管理 - テーブル形式 */

/* ボタン基底クラス - 共通要素 */
.btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
  display: inline-block;
  text-decoration: none;
  text-align: center;
  line-height: 1.5;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

/* ボタンバリエーション - 色のみ */
.btn-primary {
  background: #1e3a5f;
  color: white;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-warning {
  background: #ff9800;
  color: white;
}

.btn-info {
  background: #2196f3;
  color: white;
}

/* 戻るボタン - 共通サイズ */
.btn-back {
  padding: 12px 24px;
  font-size: 15px;
  margin-top: 0;
}

/* 標準ボタンサイズ - 共通 */
.btn-standard {
  padding: 12px 24px;
  font-size: 15px;
}

/* 画像アップロードボタン */
.btn-upload-image {
  width: 100%;
  max-width: 350px;
  padding: 12px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background 0.2s;
}

.btn-upload-image:hover {
  background: #218838;
}

/* カラーピッカーを円形にするスタイル */
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

/* リアルタイムカラーピッカーの統一スタイル */
.realtime-color-picker {
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.realtime-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

.realtime-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.realtime-color-picker::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

/* カスタムカラーアイコンの統一スタイル（パレットアイコンのみ表示） */
.custom-color-icon {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.custom-color-icon i.fa-palette {
  background: linear-gradient(135deg, #e74c3c 0%, #f1c40f 40%, #3498db 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 32px !important;
}

/* カラーサークル選択状態の統一スタイル */
.color-circle.selected {
  border: 1px solid #333 !important;
}

/* カラーサークルラベルの統一スタイル */
.color-circle-label {
  cursor: pointer;
  position: relative;
}

/* マーカープリセットラベルの統一スタイル */
.marker-preset-label {
  cursor: pointer;
  position: relative;
}

/* カラーサークルの統一スタイル */
.color-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* チェックマークの統一スタイル */
.check-mark {
  font-size: 14px;
  pointer-events: none;
}

/* カラーピッカー説明ラベルの統一スタイル */
.color-picker-label {
  font-size: 11px;
  color: #666;
}

/* チェックボックスラベルテキストの統一スタイル */
.checkbox-label-text {
  font-size: 12px;
}

/* チェックボックス外側ラベルの統一スタイル */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  padding: 8px;
  cursor: pointer;
}

/* チェックボックスグループの統一スタイル */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* セクションナビゲーションボタンの統一スタイル */
.section-nav-btn {
  padding: 12px 15px;
  text-align: left;
  background: white;
  color: #666;
  border: none;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.section-nav-btn.active {
  background: #E0E0E0;
  color: #1e3a5f;
  border-bottom: 2px solid #1e3a5f;
  font-weight: bold;
}

.section-nav-btn.sub-section {
  background: white;
}

.section-nav-btn.sub-section.active {
  background: #E0E0E0;
  font-weight: bold;
}

/* 旧クラス名の互換性維持 */
.section-nav-button {
  padding: 12px 15px;
  text-align: left;
  background: #f5f5f5;
  color: #666;
  border: none;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

/* 設定セクションコンテナの統一スタイル */
.settings-section {
  background: white;
  border: 1px solid #ccc;
  border-radius: 0 8px 8px 0;
  padding: 15px;
  height: 100%;
}

/* セクション見出しの統一スタイル */
.section-heading {
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
  font-size: 18px;
  color: #1e3a5f;
}

/* カラーピッカー列コンテナの統一スタイル */
.color-picker-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* カラーピッカー本体の位置揃え */
.color-picker-column input[type="color"] {
  margin-top: 0;
  margin-bottom: 0;
}

/* カラーピッカーフィールドラベルの統一スタイル */
.color-picker-field-label {
  font-size: 12px;
  color: #333;
  font-weight: 500;
  height: 18px;
  line-height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* テキスト装飾のコントロール部分（左側）の統一幅 */
.text-decoration-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 150px;
}

/* テキスト装飾のサンプルプレビュー（右側） */
.text-decoration-preview {
  flex: 1;
  padding: 5px 10px;
  background: #fff;
  border-radius: 3px;
  font-size: 12px;
  text-align: center;
}

/* 設定パネル内の区切り線 */
.settings-divider {
  border-top: 1px solid #ddd;
  padding-top: 12px;
  margin-top: 12px;
}

/* H1を画像に重ねる関連設定（無効時） */
.h1-overlay-option {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* H1を画像に重ねる関連設定（有効時） */
.h1-overlay-option.enabled {
  opacity: 1;
  pointer-events: auto;
}

/* H1デザイン選択カードのスタイル */
.style-card {
  padding: 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  box-shadow: none;
  position: relative;
  overflow: visible;
}

.style-card:hover {
  background: #f0f0f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.style-card-name {
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
  font-weight: bold;
  text-align: center;
}

.style-card.selected {
  border: 3px solid #ffd700 !important;
  background: transparent !important;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3) !important;
}

.lp-title-link {
  display: block;
  width: 100%;
  padding: 0;
}

.lp-list tbody td:first-child:hover .lp-title-link {
  color: #d97757 !important;
}

#managed-lp-list tbody td {
  padding: 4px 12px;
}

.style-preview {
  background: #f9f9f9;
  padding: 10px;
  margin-bottom: 5px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.h1-sample {
  font-size: 24px;
  font-weight: bold;
}

.style-name {
  text-align: center;
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

/* H1デザインプレビュー用スタイル */
.h1-sample[data-style="h1-default"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  font-weight: bold;
}

.h1-sample[data-style="h1-bottom-solid"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  border-bottom: 3px solid currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-bottom-dotted"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  border-bottom: 3px dotted currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-left-solid"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  border-left: 4px solid currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-top-bottom-solid"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  border-top: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-box"] {
  margin-top: 0;
  margin-bottom: 0;
  padding: 1rem 2rem;
  border: 2px solid currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-corner-bracket"] {
  position: relative;
  margin-top: 0;
  margin-bottom: 0;
  padding: 1em 2em;
  text-align: center;
  font-weight: bold;
}

.h1-sample[data-style="h1-corner-bracket"]:before,
.h1-sample[data-style="h1-corner-bracket"]:after {
  position: absolute;
  content: '';
}

.h1-sample[data-style="h1-corner-bracket"]:after {
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.h1-sample[data-style="h1-corner-bracket"]:before {
  right: 0;
  bottom: 0;
  width: 30px;
  height: 30px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.h1-sample[data-style="h1-box-stripe"] {
  position: relative;
  margin-top: 0;
  margin-bottom: 0;
  padding: 1.5rem 1.5rem calc(1.5rem + 10px);
  border: 2px solid currentColor;
  font-weight: bold;
}

.h1-sample[data-style="h1-box-stripe"]:after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10px;
  content: '';
  border-top: 2px solid currentColor;
  background-image: repeating-linear-gradient(-45deg, currentColor, currentColor 1px, transparent 2px, transparent 5px);
  background-size: 7px 7px;
}

/* コンバージョンページ管理 */
.cv-page-item {
  background: #e8e8e8;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 15px;
}

.cv-page-item h3 {
  margin-bottom: 15px;
  color: #333;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* デザイン設定 */
.design-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
}

.design-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.color-picker-group {
  display: grid;
  grid-template-columns: 150px 100px 1fr;
  gap: 10px;
  align-items: center;
}

.color-picker-group input[type="color"] {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

.color-picker-group input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.color-picker-group input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

.preview-box {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 20px;
  background: white;
}

.preview-box h3 {
  margin-bottom: 15px;
  color: #333;
}

.preview-button {
  display: inline-block;
  padding: 12px 24px;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  margin: 10px 10px 10px 0;
}

/* LP一覧 */
.lp-list {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.lp-list thead {
  background: #1e3a5f;
  color: white;
}

.lp-list th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.lp-list th:hover {
  background: #2c5282;
}

.lp-list th {
  position: relative;
  padding-right: 25px;
}

.lp-list th .sort-indicator {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.3;
}

.lp-list th .sort-indicator.active {
  opacity: 1;
}

.lp-list td {
  padding: 4px 12px;
  border-bottom: 1px solid #ddd;
  font-size: 14px;
  vertical-align: middle;
}

.lp-list tbody tr:hover {
  background: #f5f5f5;
}

.lp-list tbody tr:hover a {
  color: #ff8c00;
}

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

.btn-small {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.btn-edit {
  background: #667eea;
  color: white;
}

.btn-export {
  background: #17a2b8;
  color: white;
}

.btn-delete {
  background: #f44336;
  color: white;
}

.btn-small:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.success-message {
  background: #4caf50;
  color: white;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  display: none;
}

.success-message.show {
  display: block;
}

/* 新レイアウト：縦並びタブ */
.tabs {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 0;
  width: 150px;
}

.content {
  display: flex;
  gap: 20px;
}

.tabs-wrapper {
  width: 150px;
  flex-shrink: 0;
}

.content-wrapper {
  flex: 1;
}

.tab {
  text-align: left;
  border-radius: 6px;
  margin: 0;
}

/* contentEditable エディタ用 */
#lp-body-editor[contenteditable]:empty:before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}

#lp-body-editor:focus {
  outline: none;
}

/* プレースホルダー用スタイル */
.placeholder-highlight {
  color: #e74c3c;
  font-weight: 900;
  font-size: 1.1em;
}

/* 右パネル設定項目の統一スタイル */
.settings-field-group {
  margin-bottom: 12px;
}

.settings-label {
  display: block;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  height: 20px;
  line-height: 20px;
  margin-bottom: 10px;
}

.settings-input,
.settings-select {
  width: 50px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  background: white;
}

.settings-input-full {
  width: 100%;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  background: white;
}

.settings-select {
  width: 100%;
}

.settings-input-with-unit {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-unit-label {
  font-size: 12px;
  color: #666;
  margin-right: 2px;
}

.typography-item {
  flex: 0 0 80px;
}

/* 画像未選択時のグレーアウト */
.disabled-option {
  opacity: 0.5;
  transition: opacity 0.2s;
}

/* ========== デザインセットパネル ========== */

/* デザインセットトグルボタン（右下固定、テーブル作成の左） */
.design-set-toggle {
  position: fixed;
  bottom: 30px;
  right: 310px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ff9800;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.design-set-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  background: #f57c00;
}

.design-set-toggle i {
  font-size: 24px;
  color: white;
}

/* デザインセットパネル（固定配置、パレットパネルの上側） */
.design-set-panel {
  position: fixed;
  top: 300px;
  right: 580px;
  width: 700px;
  max-height: 70vh;
  background: white;
  border: 2px solid #ff9800;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.design-set-panel.active {
  display: flex;
}

/* ========== 画像一覧パネル ========== */

/* 画像一覧トグルボタン（右下固定、カラーパレットの左） */
.image-list-toggle {
  position: fixed;
  bottom: 30px;
  right: 100px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #28a745;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.image-list-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  background: #218838;
}

.image-list-toggle i {
  font-size: 24px;
  color: white;
}

/* 画像一覧パネル（固定配置、右下） */
.image-list-panel {
  position: fixed;
  bottom: 100px;
  right: 100px;
  width: 700px;
  max-height: 60vh;
  background: white;
  border: 2px solid #28a745;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.image-list-panel.active {
  display: flex;
}

/* 画像一覧ヘッダー */
.image-list-header {
  background: #28a745;
  color: white;
  padding: 8px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.image-list-header h3 {
  margin: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-list-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  line-height: 1;
}

.image-list-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 画像一覧ボディ */
.image-list-body {
  padding: 0;
  overflow-y: auto;
  max-height: calc(70vh - 60px);
}

/* ========== ボックス設定 ========== */

/* ボックス設定トグルボタン（右下固定、デザインセットの右） */
.box-settings-toggle {
  position: fixed;
  bottom: 30px;
  right: 170px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #d32f2f;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.box-settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  background: #b71c1c;
}

.box-settings-toggle i {
  font-size: 24px;
  color: white;
}

/* ボックス設定パネル（固定配置） */
.box-settings-panel {
  position: fixed;
  top: 250px;
  right: 580px;
  width: 700px;
  max-height: 70vh;
  background: white;
  border: 2px solid #d32f2f;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.box-settings-panel.active {
  display: flex;
}

/* ボックス設定パネルヘッダー（ドラッグ可能） */
.box-settings-panel-header {
  background: #d32f2f;
  color: white;
  padding: 10px;
  font-weight: 600;
  font-size: 16px;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  border-radius: 12px 12px 0 0;
}

/* ボックス設定パネル閉じるボタン */
.box-settings-panel-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: 50%;
  line-height: 1;
}

.box-settings-panel-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ボックス設定パネルボディ */
.box-settings-panel-body {
  padding: 10px;
  overflow-y: auto;
  max-height: calc(70vh - 60px);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* ボックス設定パネルの列 */
.box-settings-panel-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-right: 15px;
  border-right: 1px solid #e0e0e0;
}

.box-settings-panel-column:last-child {
  border-right: none;
  padding-right: 0;
}

/* ボックス設定パネルプレビューセクション（横一列横断） */
.box-settings-panel-preview-section {
  width: 100%;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
  overflow-y: auto;
}

/* ========== カスタムカラーパレット ========== */

/* パレット開閉トグルボタン（右下固定） */
.color-palette-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #667eea;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.color-palette-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  background: #5568d3;
}

.color-palette-toggle i {
  font-size: 24px;
  color: white;
}

/* パレットパネル（固定配置、右下） */
.color-palette-panel {
  position: fixed;
  bottom: 100px;
  right: 580px;
  width: 500px;
  max-height: none;
  background: white;
  border: 2px solid #667eea;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.color-palette-panel.active {
  display: flex;
}

/* パレットヘッダー */
.color-palette-header {
  background: #667eea;
  color: white;
  padding: 8px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.color-palette-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.color-palette-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 20px;
  line-height: 1;
}

.color-palette-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* パレットボディ */
.color-palette-body {
  padding: 10px;
  overflow-y: auto;
  height: 435px;
}

/* 色追加セクション */
.color-add-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.color-add-controls {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

.color-add-picker {
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-code-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: monospace;
  text-transform: uppercase;
}

.color-add-button {
  flex: 1;
  padding: 10px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.color-add-button:hover {
  background: #45a049;
}

/* パレットセット管理 */
.palette-set-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.palette-set-header {
  margin-bottom: 10px;
}

.palette-set-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
}

.palette-set-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.palette-set-name-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.palette-set-save-button {
  padding: 6px 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}

.palette-set-save-button:hover {
  background: #5568d3;
}

.palette-set-load-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.palette-set-select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

.palette-set-load-button {
  padding: 6px 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
  white-space: nowrap;
}

.palette-set-load-button:hover {
  background: #5568d3;
}

.palette-set-delete-button {
  padding: 6px 12px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.palette-set-delete-button:hover {
  background: #d32f2f;
}

/* カラーグリッド */
.color-palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  width: 100%;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

.color-palette-item {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  aspect-ratio: 1;
  cursor: pointer;
  border: 1px solid #ddd;
  transition: all 0.2s;
  box-sizing: border-box;
}

.color-palette-item:hover {
  border-color: #667eea;
  border-width: 2px;
  z-index: 1;
}

/* 固定プリセットはホバーエフェクトなし */
#fixed-color-palette-grid .color-palette-item:hover {
  border-color: #ddd;
  border-width: 1px;
  z-index: 0;
}

/* 各パレットグリッドを6列に固定 */
#system-color-palette-grid {
  grid-template-columns: repeat(6, 1fr) !important;
  grid-auto-columns: 1fr !important;
  grid-auto-rows: min-content !important;
  grid-auto-flow: row !important;
  align-items: start !important;
  max-height: none !important;
  overflow: hidden !important;
}

#user-color-palette-grid {
  grid-template-columns: repeat(6, 1fr) !important;
  grid-auto-columns: 1fr !important;
  grid-auto-rows: min-content !important;
  grid-auto-flow: row !important;
  align-items: start !important;
}

#fixed-color-palette-grid {
  grid-template-columns: repeat(6, 1fr) !important;
  grid-template-rows: repeat(4, 1fr) !important;
  grid-auto-columns: 1fr !important;
  grid-auto-rows: min-content !important;
  grid-auto-flow: row !important;
  align-items: start !important;
  max-height: none !important;
  overflow: hidden !important;
}

.color-palette-item-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: #f44336;
  color: white;
  border: 1.5px solid white;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  z-index: 2;
}

.color-palette-item:hover .color-palette-item-delete {
  display: flex;
}

.color-palette-item-delete:hover {
  background: #d32f2f;
}

/* 空状態メッセージ */
.color-palette-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}


/* ローディングスピナー */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ボックスデザインカードスタイル */
.box-design-card-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
}

.box-design-card-group .style-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ボックスデザインプレビュー */
.box-design-preview {
  font-size: 11px;
  list-style: none;
  padding: 8px;
  margin: 0;
}

.box-design-preview li {
  padding-left: 0;
  margin: 0;
}

/* 各デザインのプレビュースタイル */
.box-design-preview[data-design="bg-yellow"] {
  background-color: #fffacd;
  padding: 8px 12px;
}

.box-design-preview[data-design="offset-shadow"] {
  position: relative;
  z-index: 0;
  background: transparent;
  border: 2px solid #2589d0;
  padding: 8px 12px;
}

.box-design-preview[data-design="offset-shadow"]::after {
  content: '';
  background-color: var(--offset-shadow-bg-color, #fffacd);
  width: 100%;
  height: 100%;
  position: absolute;
  top: -5px;
  left: 5px;
  z-index: -1;
}

.box-design-preview[data-design="box-018"] {
  position: relative;
  padding: 8px 12px;
  border: none;
  border-top: 1px solid #2589d0;
  border-bottom: 1px solid #2589d0;
  background: transparent;
}

.box-design-preview[data-design="box-018"]::before,
.box-design-preview[data-design="box-018"]::after {
  content: '';
  position: absolute;
  width: 1px;
  top: 50%;
  transform: translateY(-50%);
  height: calc(100% + 8px);
  background-color: #2589d0;
}

.box-design-preview[data-design="box-018"]::before {
  left: 4px;
}

.box-design-preview[data-design="box-018"]::after {
  right: 4px;
}

.box-design-preview[data-design="box-design7"] {
  padding: 8px 12px;
  background-color: #f3f2f3;
  border: none;
}

.box-design-preview[data-design="box-design6"] {
  padding: 8px 12px;
  border: 1px solid #4c9ac0;
  position: relative;
  background: transparent;
}

.box-design-preview[data-design="box-design6"] li {
  background-image: linear-gradient(90deg, rgba(237, 119, 128, 0) 0%, rgba(237, 119, 128, 0) 50%, #fff 0%, #fff 100%), linear-gradient(180deg, rgba(237, 119, 128, 0) 0%, rgba(237, 119, 128, 0) 95%, #4c9ac0 100%);
  background-size: 4px 100%, 100% 1.2em;
  line-height: 1.2;
}

.box-design-preview[data-design="box-design11"] {
  padding: 8px 12px;
  background: #b2d3e4;
  box-shadow: 0 0 0 6px #b2d3e4;
  border: 1px dashed #fff;
}

.box-design-preview[data-design="box-003"] {
  padding: 8px 12px;
  box-shadow: 0 2px 2px rgb(0 0 0 / 5%);
  background-image: linear-gradient(transparent calc(100% - 1px), #e6edf3 50%, #e6edf3), linear-gradient(90deg, transparent calc(100% - 1px), #e6edf3 50%, #e6edf3);
  background-size: 8px 8px;
  background-repeat: repeat;
  background-color: #ffffff;
}


.container {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
h1 {
  color: #333;
  margin-bottom: 20px;
}
.message {
  line-height: 1.8;
  color: #555;
  margin-bottom: 30px;
}
.cta-button {
  display: inline-block;
  padding: 18px 40px;
  background: ${cvPage.ctaColor};
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  font-size: 18px;
  transition: transform 0.3s;
}
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.extra-content {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e0e0e0;
}

/* ========== 診断LP編集画面専用スタイル ========== */

/* 診断LP設定セクションコンテナ */
.diagnostic-settings-section {
  display: none;
}

.diagnostic-settings-section h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #1e3a5f;
}

/* 診断LP設定フィールドグループ */
.diagnostic-settings-fields {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.diagnostic-field-group {
  display: flex;
  flex-direction: column;
}

.diagnostic-field-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 5px;
}




/* LP編集画面のメイングリッド（HTML・プレビュー・設定パネル） */
.lp-editor-main-grid {
  display: grid;
  grid-template-columns: 350px 1fr 550px;
  gap: 20px;
  height: calc(100vh - 320px);
}

/* LP編集画面の各パネル（ビューポートサイズ依存） */
.lp-editor-panel {
  background: #F0F0F1;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.lp-editor-textarea,
.lp-editor-contenteditable {
  width: calc(100% + 30px);
  flex: 1;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 12px;
  padding: 10px;
  border: 1px solid #ccc;
  border-left: none;
  border-right: none;
  border-radius: 0;
  resize: none;
  overflow-y: auto;
  margin-left: -15px;
  margin-right: -15px;
  margin-bottom: -15px;
}

.lp-editor-contenteditable {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: white;
  color: #333;
  line-height: 1.5;
}

.lp-preview-iframe {
  width: calc(100% + 30px);
  flex: 1;
  border: none;
  border-top: 1px solid #ccc;
  border-radius: 0;
  overflow: hidden;
  background: #F0F0F1;
  margin-left: -15px;
  margin-right: -15px;
  margin-bottom: -15px;
}

.lp-settings-sidebar {
  background: white;
  border: 1px solid #ccc;
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.lp-settings-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100%;
}

/* デバイス切り替えボタン */
.preview-device-toggle {
  padding: 6px 12px;
  background: #1e3a5f;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100px;
  height: 36px;
}

.preview-device-toggle:hover {
  background: #2c5282;
}

/* メインコンテンツエリア */
.main-content {
  background: #F0F0F1;
}

.content-section {
  background: #F0F0F1;
  padding: 20px;
}

/* 診断LP編集画面 */
#diagnostic-lp-editor-screen {
  background: #F0F0F1;
}

/* 通常LP編集画面 */
#lp-editor-screen {
  background: #F0F0F1;
}

/* スラッグ入力欄のスタイル強制（オートフィル対策） */
input[type="text"]#lp-slug-editor,
input[type="text"]#diagnostic-lp-slug-editor {
  flex: 1 !important;
  min-width: 100px !important;
  padding: 6px 10px !important;
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  font-size: 13px !important;
  background-color: #fff !important;
  background-image: none !important;
  background: #fff !important;
  color: #333 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #333 !important;
  outline: none !important;
}

input[type="text"]#lp-slug-editor:focus,
input[type="text"]#diagnostic-lp-slug-editor:focus {
  background-color: #fff !important;
  background: #fff !important;
  border-color: #ccc !important;
  outline: none !important;
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
}

input[type="text"]#lp-slug-editor:-webkit-autofill,
input[type="text"]#diagnostic-lp-slug-editor:-webkit-autofill,
input[type="text"]#lp-slug-editor:-webkit-autofill:hover,
input[type="text"]#diagnostic-lp-slug-editor:-webkit-autofill:hover,
input[type="text"]#lp-slug-editor:-webkit-autofill:focus,
input[type="text"]#diagnostic-lp-slug-editor:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #333 !important;
  border: 1px solid #ccc !important;
}

/* インライン編集ボタン（ホバー時のみ表示） */
.btn-edit-inline {
  padding: 2px 6px;
  font-size: 14px;
  background: transparent;
  color: #999;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

tr:hover .btn-edit-inline {
  opacity: 1;
}

/* LP一覧テーブル内のアクションボタンを常時表示 */

/* デザインセットパネル内の編集ボタンもホバー時のみ表示 */
.design-set-row .btn-edit-inline {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.design-set-row:hover .btn-edit-inline {
  opacity: 1;
}

/* デザインセットパネル内の行ホバー背景色（LP一覧と統一） */
.design-set-row:hover {
  background: #f5f5f5 !important;
}

/* オーバーレイメッセージ（画像生成中など） */
.overlay-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay-message.show {
  opacity: 1;
}

.overlay-message-box {
  background: #333;
  color: white;
  padding: 30px 50px;
  border-radius: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ========== テーブル設定パネル ========== */

/* テーブル設定トグルボタン（右下固定、画像一覧の左） */
.table-settings-toggle {
  position: fixed;
  bottom: 30px;
  right: 240px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #00bcd4;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.table-settings-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  background: #0097a7;
}

.table-settings-toggle i {
  font-size: 24px;
  color: white;
}

/* テーブル設定パネル（固定配置） */
.table-settings-panel {
  position: fixed;
  top: 200px;
  right: 450px;
  width: 520px;
  max-height: 75vh;
  background: white;
  border: 2px solid #00bcd4;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.table-settings-panel.active {
  display: flex;
}

/* テーブル設定パネルヘッダー（ドラッグ可能） */
.table-settings-panel-header {
  background: #00bcd4;
  color: white;
  padding: 10px;
  font-weight: 600;
  font-size: 16px;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  border-radius: 12px 12px 0 0;
}

/* テーブル設定パネル閉じるボタン */
.table-settings-panel-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: 50%;
  line-height: 1;
}

.table-settings-panel-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* テーブル設定パネルボディ */
.table-settings-panel-body {
  padding: 10px;
  overflow-y: auto;
  max-height: calc(75vh - 60px);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* テーブル設定パネルの列 */
.table-settings-panel-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 15px;
  border-right: 1px solid #e0e0e0;
}

.table-settings-panel-column:last-child {
  border-right: none;
  padding-right: 0;
}

/* テーブル設定パネルプレビューセクション */
.table-settings-panel-preview-section {
  width: 100%;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
}

/* テーブル設定プレビュー */
#table-settings-preview {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

#table-settings-preview th,
#table-settings-preview td {
  padding: 8px 10px;
  text-align: center;
}

/* テーブル設定のフィールドグループ */
.table-settings-field-group {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.table-settings-field-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* テーブルプリセット管理セクション */
.table-preset-section {
  padding: 10px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  gap: 10px;
}

.table-preset-section select {
  flex: 1;
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.table-preset-section .btn-group {
  display: flex;
  gap: 6px;
}
