/* WorkStock - lit.link風プロフィールリンクページ */

.workstock-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

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

.workstock-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
}

.workstock-header .subtitle {
  color: #64748b;
  font-size: 0.95rem;
  margin: 0;
}

/* タブナビゲーション */
.workstock-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0;
}

.workstock-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.workstock-tab:hover {
  color: #94a3b8;
}

.workstock-tab.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

.workstock-tab svg {
  opacity: 0.7;
}

.workstock-tab.active svg {
  opacity: 1;
}

/* タブコンテンツ */
.tab-content {
  display: none;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* コンテンツエリア */
.workstock-content {
  display: grid;
  grid-template-columns: 1fr 780px;
  gap: 2rem;
}

@media (max-width: 1200px) {
  .workstock-content {
    grid-template-columns: 1fr 400px;
  }
}

@media (max-width: 900px) {
  .workstock-content {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    order: -1;
  }
}

/* 編集パネル */
.edit-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.edit-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* セクション番号バッジ */
.edit-section .section-number {
  position: absolute;
  top: -8px;
  left: 12px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #7c3aed;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* プロフィール・背景画像セクション */
.edit-section-muted {
  background: #ffffff;
  border-color: #e5e7eb;
}

.edit-section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #000000;
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.edit-section h2 svg {
  color: #6366f1;
}

.section-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: #64748b;
  margin-left: 0.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
}

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

.section-delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #ef4444;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.section-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

/* セクション右下の削除ボタン */
.sortable-section,
.dynamic-section {
  position: relative;
  padding-bottom: 3rem; /* 削除ボタン用のスペース */
}

.section-delete-btn-bottom {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.section-delete-btn-bottom:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
  transform: scale(1.05);
}

/* セクション設定エリア（インライン編集） */
.section-settings {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
}

.section-settings .settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.section-settings .settings-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #000000;
}

.section-settings .settings-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.section-settings .settings-close-btn:hover {
  color: #1e293b;
}

.section-settings .form-group {
  margin-bottom: 0.75rem;
}

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

.section-settings label {
  display: block;
  font-size: 0.75rem;
  color: #374151;
  margin-bottom: 0.25rem;
}

.section-settings input[type="text"],
.section-settings input[type="url"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #1e293b;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.section-settings input[type="text"]:focus,
.section-settings input[type="url"]:focus {
  outline: none;
  border-color: #6366f1;
}

.section-settings .url-input {
  font-family: monospace;
  font-size: 0.8rem;
}

/* アスペクト比ボタン */
.aspect-ratio-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.aspect-btn {
  padding: 0.4rem 0.6rem;
  background: #f8fafc;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #64748b;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.aspect-btn:hover {
  border-color: #6366f1;
  color: #4f46e5;
}

.aspect-btn.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

/* 選択中のアイテム */
.link-card-item.selected,
.work-item.selected,
.block-item.selected {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* セクションタイトル入力 */
.section-title-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: #000000;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.25rem 0;
  flex: 1;
  min-width: 0;
  transition: border-color 0.2s;
  caret-color: #6366f1;
}

.section-title-input:hover {
  border-bottom-color: #e2e8f0;
}

.section-title-input:focus {
  outline: none;
  border-bottom-color: #6366f1;
}

.section-title-input::placeholder {
  color: #64748b;
}

/* 編集可能であることを示す点滅カーソル */
.section-title-input:not(:focus)::after {
  content: '|';
  animation: blink 1s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.section-title-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.section-title-cursor {
  position: absolute;
  color: #000000;
  font-weight: 400;
  font-size: 1em;
  animation: cursor-blink 0.8s step-end infinite;
  text-shadow: none;
  pointer-events: none;
  top: 50%;
  transform: translateY(-50%);
}

.section-title-input:focus + .section-title-cursor {
  display: none;
}

/* セクション追加ボタン */
.btn-add-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 50%;
  margin: 0 auto;
  padding: 1rem;
  background: transparent;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  color: #64748b;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-section:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
}

.btn-add-section svg {
  flex-shrink: 0;
}

.section-description {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

/* サブセクション（背景設定内のセクション設定など） */
.subsection-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 1.5rem 0;
}

.subsection-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #000000;
  margin: 0 0 0.5rem 0;
}

.subsection-title svg {
  color: #6366f1;
  opacity: 0.8;
}

/* セクション背景コントロール */
.section-color-single {
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.section-color-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-color-controls input[type="color"] {
  width: 40px;
  height: 40px;
  padding: 3px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.section-color-controls input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.section-color-controls input[type="color"]::-webkit-color-swatch {
  border-radius: 6px;
  border: none;
}

.section-color-controls input[type="range"] {
  -webkit-appearance: none;
  flex: 1;
  height: 8px;
  background: linear-gradient(90deg, #e0e7ff, #c7d2fe, #e0e7ff);
  border-radius: 999px;
  cursor: pointer;
}

.section-color-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.section-color-controls input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.5);
}

.section-color-controls input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  cursor: pointer;
}

.section-color-controls .opacity-value {
  font-size: 0.9rem;
  color: #6366f1;
  font-weight: 600;
  min-width: 45px;
  text-align: right;
}

/* フォーム */
.form-group {
  margin-bottom: 1rem;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #1e293b;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #6366f1;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #64748b;
}

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

/* スライダー */
.form-group input[type="range"].slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  border: none;
  padding: 0;
  cursor: pointer;
}

.form-group input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: #6366f1;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.form-group input[type="range"].slider::-webkit-slider-thumb:hover {
  background: #818cf8;
}

.form-group input[type="range"].slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #6366f1;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* アスペクト比スライダー */
.aspect-ratio-slider {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.aspect-ratio-slider label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.75rem;
}

.aspect-ratio-slider #aspectRatioLabel {
  color: #6366f1;
  font-weight: 600;
}

.aspect-slider-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.aspect-slider-container .aspect-label {
  font-size: 0.75rem;
  color: #64748b;
  min-width: 32px;
  text-align: center;
}

.aspect-slider-container input[type="range"] {
  -webkit-appearance: none;
  flex: 1;
  height: 8px;
  background: linear-gradient(to right, #c7d2fe, #a5b4fc, #c7d2fe);
  border-radius: 4px;
  cursor: pointer;
}

.aspect-slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #6366f1;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: background 0.2s, transform 0.2s;
}

.aspect-slider-container input[type="range"]::-webkit-slider-thumb:hover {
  background: #818cf8;
  transform: scale(1.1);
}

.aspect-slider-container input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #6366f1;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.input-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.5rem;
}

/* 統計セクション */
.stats-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #94a3b8;
  padding: 1rem 0;
}

.loading-spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 期間タブ */
.stats-period-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.period-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.period-tab:hover {
  background: #f1f5f9;
  color: #374151;
}

.period-tab.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

/* 期間内クリック数 */
.stats-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.stats-total-label {
  font-size: 0.85rem;
  color: #64748b;
}

.stats-total-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
}

/* 横棒グラフ */
.stats-chart {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.stats-chart:empty {
  display: none;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

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

.chart-image {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
}

.chart-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chart-image-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #d1d5db;
}

.chart-content {
  flex: 1;
  min-width: 0;
}

.chart-label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-bar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-bar {
  height: 24px;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.3s ease;
}

.chart-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  min-width: 40px;
}

.stats-empty {
  text-align: center;
  color: #64748b;
  padding: 1rem;
  font-size: 0.9rem;
}

/* セクションバッジ（画像別クリック数用） */
.section-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: #e0e7ff;
  color: #4f46e5;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
}

/* OGPセクション（プレビュー下） */
.ogp-section-panel {
  margin-top: 1.5rem;
}

/* OGPアップロード */
.ogp-upload-area {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 630;
  background: #f8fafc;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
}

.ogp-upload-area:hover {
  border-color: #6366f1;
}

.ogp-upload-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.upload-placeholder svg {
  margin-bottom: 0.5rem;
}

.upload-placeholder p {
  margin: 0;
  font-size: 0.9rem;
}

.upload-placeholder span {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* アバターアップロード */
.avatar-upload-area {
  position: relative;
  width: 100px;
  height: 100px;
  background: #f8fafc;
  border: 2px dashed #d1d5db;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
}

.avatar-upload-area:hover {
  border-color: #6366f1;
}

.avatar-upload-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  border-radius: 50%;
}

/* プロフィール画像表示エリア（読み取り専用） */
.avatar-display-area {
  position: relative;
  width: 100px;
  height: 100px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 50%;
  overflow: hidden;
}

.avatar-display-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.form-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.5rem;
}

.form-hint a {
  color: #6366f1;
  text-decoration: none;
}

/* 背景画像アップロード */
/* 背景タブ */
.bg-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 10px;
}

.bg-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.bg-tab:hover {
  color: #374151;
}

.bg-tab.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bg-tab svg {
  flex-shrink: 0;
}

.bg-tab-content {
  display: none;
}

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

/* カラーピッカーセクション */
.color-picker-section {
  padding: 0.5rem 0;
}

.color-presets {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.color-preset-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.color-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.color-preset-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.color-preset {
  width: 36px;
  height: 36px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.color-preset:hover {
  transform: scale(1.1);
}

.color-preset.selected {
  border-color: #1e293b;
  box-shadow: 0 0 0 2px #6366f1;
}

.color-preset[data-color="#0f172a"] { background: #0f172a; }
.color-preset[data-color="#1e1e1e"] { background: #1e1e1e; }
.color-preset[data-color="#18181b"] { background: #18181b; }
.color-preset[data-color="#1e293b"] { background: #1e293b; }
.color-preset[data-color="#292524"] { background: #292524; }
.color-preset[data-color="#1f2937"] { background: #1f2937; }
.color-preset[data-color="#dc2626"] { background: #dc2626; }
.color-preset[data-color="#ea580c"] { background: #ea580c; }
.color-preset[data-color="#ca8a04"] { background: #ca8a04; }
.color-preset[data-color="#16a34a"] { background: #16a34a; }
.color-preset[data-color="#2563eb"] { background: #2563eb; }
.color-preset[data-color="#9333ea"] { background: #9333ea; }

/* グラデーションプリセット */
.color-preset.gradient[data-gradient*="667eea"] { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.color-preset.gradient[data-gradient*="f093fb"] { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.color-preset.gradient[data-gradient*="4facfe"] { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.color-preset.gradient[data-gradient*="43e97b"] { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.color-preset.gradient[data-gradient*="fa709a"] { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.color-preset.gradient[data-gradient*="a18cd1"] { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
.color-preset.gradient[data-gradient*="ff9a9e"] { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.color-preset.gradient[data-gradient*="ffecd2"] { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.color-preset.gradient[data-gradient*="a1c4fd"] { background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%); }
.color-preset.gradient[data-gradient*="d299c2"] { background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%); }
.color-preset.gradient[data-gradient*="89f7fe"] { background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%); }
.color-preset.gradient[data-gradient*="fddb92"] { background: linear-gradient(135deg, #fddb92 0%, #d1fdff 100%); }

/* なし（透明）ボタン */
.color-preset.none {
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #ffffff 0% 50%) 50% / 12px 12px;
  border: 1px solid #d1d5db;
}

/* 白ボタン */
.color-preset.solid-white {
  background: #ffffff;
  border: 1px solid #d1d5db;
}

/* セクション背景設定 */
.section-bg-settings {
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
}

.section-opacity-separate {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

/* カスタムカラー入力 */
.custom-color-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.custom-color-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.custom-color-input-row input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 2px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.custom-color-input-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.custom-color-input-row input[type="color"]::-webkit-color-swatch {
  border-radius: 4px;
  border: none;
}

.custom-color-input-row input[type="text"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #1e293b;
  font-size: 0.9rem;
  font-family: monospace;
}

.btn-apply-color {
  padding: 0.5rem 1rem;
  background: #6366f1;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-apply-color:hover {
  background: #4f46e5;
}

/* 背景色プレビュー */
.current-bg-preview {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.bg-color-preview-box {
  width: 100%;
  height: 80px;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  transition: all 0.3s;
}

.bg-preview-label {
  color: #64748b;
  font-size: 0.85rem;
}

/* 背景色クリアボタン */
.btn-clear-bg-color {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #ef4444;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear-bg-color:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

.background-image-upload {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
}

.background-image-upload:hover {
  border-color: #6366f1;
}

.background-image-upload img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.background-image-upload .upload-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.btn-text-danger {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

.btn-text-danger:hover {
  text-decoration: underline;
}

.form-hint a:hover {
  text-decoration: underline;
}

/* SNS OGPプレビュー */
.sns-ogp-preview {
  width: 100%;
  aspect-ratio: 1200 / 630;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.sns-ogp-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sns-ogp-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.sns-ogp-placeholder p {
  margin: 0.5rem 0 0 0;
  font-size: 0.85rem;
}

/* URL入力 + ボタン */
.input-with-button {
  display: flex;
  gap: 0.5rem;
}

.input-with-button input {
  flex: 1;
}

.btn-fetch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-fetch:hover {
  background: #4f46e5;
}

.btn-fetch:disabled {
  background: #475569;
  cursor: not-allowed;
}

.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.25rem;
}

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

.form-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.5rem;
}

/* SNSアイコンリスト */
.sns-icon-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.sns-icon-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.sns-icon-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sns-icon-info {
  flex: 1;
  min-width: 0;
}

.sns-icon-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  margin: 0;
}

.sns-icon-url {
  font-size: 0.7rem;
  color: #64748b;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* SNSアイコンアイテム内の削除ボタン */
.sns-icon-item .link-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sns-icon-item .link-actions button {
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.sns-icon-item .link-actions button:hover {
  background: #f1f5f9;
  color: #374151;
}

.sns-icon-item .link-actions button.delete:hover {
  background: #ef4444;
}

/* 追加ボタン */
.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add:hover {
  border-color: #6366f1;
  color: #6366f1;
}

/* カード型追加ボタン */
.btn-add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-card:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
}

/* ピックアップ用 - 16:9横長 */
.btn-add-card-pickup {
  width: 100%;
  aspect-ratio: 16 / 9;
}

/* ギャラリー用 - 3:4 縦長 */
.btn-add-card-portrait {
  aspect-ratio: 3 / 4;
}

/* 空のスロット（+ボタン） */
.slot-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.slot-empty:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
}

/* ギャラリー用空スロット - 3:4 縦長 */
.slot-empty-work {
  aspect-ratio: 3 / 4;
}

/* ピックアップ用空スロット - 16:9横長 */
.slot-empty-link {
  aspect-ratio: 1;  /* デフォルト1:1 */
  width: 100%;
}

/* ドラッグ中のスタイル */
.work-item.dragging,
.link-card-item.dragging {
  opacity: 0.5;
}

.work-item.drag-over,
.link-card-item.drag-over {
  border-color: #6366f1;
  border-style: dashed;
}

/* リンクリスト */
.sns-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* カスタムリンクリスト - 縦1列 */
.custom-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* 作品リスト - 3列グリッド */
.works-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

/* ブロックリスト - 2×2グリッド */

/* フォント設定セクション */
.font-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.font-setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.font-setting-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.font-setting-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.font-setting-controls select {
  flex: 1;
  min-width: 120px;
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #374151;
  font-size: 0.875rem;
  cursor: pointer;
}

.font-setting-controls select:hover {
  border-color: #475569;
}

.font-setting-controls select:focus {
  outline: none;
  border-color: #60a5fa;
}

.font-setting-controls input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 2px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
}

.font-setting-controls input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.font-setting-controls input[type="color"]::-webkit-color-swatch {
  border-radius: 4px;
  border: none;
}

.font-size-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 140px;
}

.font-size-control input[type="range"] {
  flex: 1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.font-size-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #60a5fa;
  border-radius: 50%;
  cursor: pointer;
}

.font-size-control span {
  font-size: 0.75rem;
  color: #64748b;
  min-width: 36px;
  text-align: right;
}

.color-label {
  font-size: 0.75rem;
  color: #64748b;
}

.font-settings-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.font-settings-footer .btn-text {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.font-settings-footer .btn-text:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.btn-reset-danger {
  background: #dc2626;
  border: none;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-reset-danger:hover {
  background: #b91c1c;
}

.blocks-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-bottom: 1rem;
  align-items: start;
}

/* ブロックアイテム - 1:1カード */
.block-item {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.block-item:hover {
  border-color: #6366f1;
}

.block-item.block-item-clickable {
  cursor: pointer;
}

.block-item.block-item-clickable:hover {
  transform: translateY(-2px);
}

.block-item .block-image {
  width: 100%;
  height: 100%;
}

.block-item .block-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.block-item .block-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.block-item .block-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ブロック削除ボタン */
.block-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 10;
}

.block-item:hover .block-delete-btn {
  opacity: 1;
}

.block-delete-btn:hover {
  background: #dc2626;
}

/* ブロック空スロット - 1:1 */
.slot-empty-block {
  aspect-ratio: 1 / 1;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

/* 作品アイテム - 3:4カード */
.work-item {
  position: relative;
  /* aspect-ratio: インラインスタイルで設定 */
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.work-item:hover {
  border-color: #6366f1;
}

.work-item.work-item-clickable {
  cursor: pointer;
}

.work-item.work-item-clickable:hover {
  transform: translateY(-2px);
}

.work-item .work-image {
  width: 100%;
  height: 100%;
}

.work-item .work-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-item .work-image-container {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.work-item .work-image-container img {
  width: 100%;
  height: 100%;
  display: block;
}

.work-item .work-icon-svg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.work-item .work-icon-svg svg {
  width: 48px;
  height: 48px;
}

.work-item .work-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.work-item .work-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 画像削除ボタン（右上×） - 共通スタイル */
.work-delete-btn,
.image-delete-btn,
.link-card-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  background: #ef4444;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.work-item:hover .work-delete-btn,
.ogp-upload-area:hover .image-delete-btn,
.link-card-item:hover .link-card-delete-btn {
  opacity: 1;
}

/* 背景画像の削除ボタンは常時表示 */
.background-image-upload .image-delete-btn {
  opacity: 1;
}

.work-delete-btn:hover,
.image-delete-btn:hover,
.link-card-delete-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.link-item .link-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0e7ff;
  border-radius: 8px;
  color: #4f46e5;
}

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

.link-item .link-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #1e293b;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-item .link-url {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-item .link-actions {
  display: flex;
  gap: 0.5rem;
}

.link-item .link-actions button {
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.link-item .link-actions button:hover {
  background: #e2e8f0;
  color: #374151;
}

.link-item .link-actions button.delete:hover {
  background: #ef4444;
}

/* カスタムリンクカード（編集パネル） - 公開ページと同じデザイン */
.link-card-item {
  position: relative;
  display: block;
  background: #0a0a0f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.link-card-item.link-card-clickable {
  cursor: pointer;
  transition: all 0.2s;
}

.link-card-item.link-card-clickable:hover {
  border-color: #7c3aed;
  transform: translateY(-2px);
}

.link-card-image {
  width: 100%;
  aspect-ratio: 1;  /* デフォルト1:1、インラインスタイルで上書き */
  background: rgba(255, 255, 255, 0.05);
}

.link-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-card-image-empty {
  background: rgba(255, 255, 255, 0.05);
}

.link-card-content {
  padding: 0.75rem;
}

.link-card-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.25rem 0;
}

.link-card-description {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.link-card-url {
  font-size: 0.6rem;
  color: #94a3b8;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card-tracking {
  font-size: 0.7rem;
  margin: 0.25rem 0 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.link-card-tracking .tracking-label {
  color: #22c55e;
  font-weight: 500;
}

.link-card-tracking .tracking-url {
  color: #6366f1;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}

.link-card-tracking .tracking-url:hover {
  color: #818cf8;
  text-decoration: underline;
}

/* カスタムリンク削除ボタン（右上×） */
.link-card-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  background: #ef4444;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.link-card-item:hover .link-card-delete-btn {
  opacity: 1;
}

.link-card-delete-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* リンクカード画像アップロード */
.link-card-image-upload {
  position: relative;
  width: 100%;
  aspect-ratio: 1;  /* 常に1:1 */
  max-height: 35vh;  /* スクロール防止 */
  background: #f8fafc;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-card-image-upload:hover {
  border-color: #6366f1;
}

.link-card-image-upload img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* OGP読み込み中オーバーレイ */
.ogp-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 10;
}

.ogp-loading-overlay p {
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 0;
}

.ogp-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 画像変更オーバーレイ */
.image-change-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
  pointer-events: none;
}

.image-change-overlay svg {
  color: #e2e8f0;
}

.image-change-overlay p {
  color: #e2e8f0;
  font-size: 0.85rem;
  margin: 0;
}

.link-card-image-upload:hover .image-change-overlay {
  opacity: 1;
}

/* 画像が無い時は変更オーバーレイを非表示 */
.link-card-image-upload:not(.has-image) .image-change-overlay {
  display: none;
}

/* 画像フィット方法切り替え */
.image-fit-options {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.fit-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #64748b;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.fit-option:hover {
  background: #e2e8f0;
  color: #374151;
}

.fit-option.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.fit-option svg {
  flex-shrink: 0;
}

/* 保存エリア */
.save-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-top: 1rem;
}

.save-area-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-save {
  flex: 1;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: #e2e8f0;
  color: #374151;
}

.btn-secondary:hover {
  background: #d1d5db;
}

/* プレビューパネル */
.preview-panel {
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.preview-header span {
  font-size: 0.9rem;
  font-weight: 600;
  color: #94a3b8;
}

.preview-url {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #64748b;
}

.preview-url svg {
  flex-shrink: 0;
}

.btn-copy {
  padding: 0.25rem;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: #e2e8f0;
  color: #374151;
}

/* スマホモックアップ */
.preview-frame {
  display: flex;
  justify-content: center;
}

.phone-mockup {
  width: 320px;
  background: #000;
  border-radius: 40px;
  padding: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* 上部のノッチエリア（ダイナミックアイランド風） */
.phone-notch {
  height: 32px;
  background: #000;
  border-radius: 32px 32px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-notch::after {
  content: '';
  width: 80px;
  height: 24px;
  background: #1a1a1a;
  border-radius: 20px;
}

.phone-screen {
  background: linear-gradient(180deg, #1e1e2e 0%, #0f0f1a 100%);
  border-radius: 0;
  height: 580px;
  max-height: 580px;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE/Edge */
}

/* iframe版プレビュー */
iframe.phone-screen {
  width: 100%;
  border: none;
  overflow: hidden;
}

.phone-screen::-webkit-scrollbar {
  display: none !important; /* Chrome/Safari/Opera */
  width: 0 !important;
}

/* ホバー時もスクロールバーを非表示に維持 */
.phone-mockup:hover .phone-screen {
  scrollbar-width: none !important;
}

.phone-mockup:hover .phone-screen::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
}

.phone-screen::-webkit-scrollbar-track,
.phone-screen::-webkit-scrollbar-thumb,
.phone-mockup:hover .phone-screen::-webkit-scrollbar-track,
.phone-mockup:hover .phone-screen::-webkit-scrollbar-thumb,
.phone-mockup:hover .phone-screen::-webkit-scrollbar-thumb:hover {
  display: none !important;
  background: transparent !important;
  width: 0 !important;
  height: 0 !important;
}

/* 下部のホームバーエリア */
.phone-home-bar {
  height: 28px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 0 32px 32px;
}

.phone-home-bar::after {
  content: '';
  width: 120px;
  height: 5px;
  background: #333;
  border-radius: 3px;
}

/* ファイルサイズ表示 */
.file-size-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1rem;
}

.file-size-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.file-size-label {
  color: #000;
}

.file-size-value {
  color: #000;
  font-family: monospace;
}

.file-size-total {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid #e2e8f0;
}

.file-size-total .file-size-value {
  color: #000;
  font-weight: 600;
}

/* プレビューコンテンツ */
.preview-content {
  padding: 2rem 1.5rem;
  text-align: center;
}

.preview-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  background: #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-avatar svg {
  color: #64748b;
}

.preview-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem 0;
}

.preview-bio {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
}

/* プレビュー SNSアイコン */
.preview-sns-icons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.preview-sns-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  border-radius: 50%;
  color: #fff;
  transition: transform 0.2s;
}

.preview-sns-icon:hover {
  transform: scale(1.1);
}

/* プレビュー SNSアイコン（OGP画像版） */
.preview-sns-icon-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s;
}

.preview-sns-icon-img:hover {
  transform: scale(1.1);
}

.preview-sns-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* プレビュー セクション間隔統一 */
.preview-links,
.preview-works-section,
.preview-pickup-section,
.preview-text-section,
.preview-text-section-wrap,
.preview-dynamic-section,
.preview-blocks-section {
  margin-top: 1.5rem;
}

/* プレビュー リンクカード */
.preview-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-link-card {
  display: block;
  background: #0a0a0f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  transition: all 0.2s;
}

.preview-link-card:hover {
  border-color: #7c3aed;
  transform: translateY(-2px);
}

.preview-link-card-image {
  width: 100%;
  aspect-ratio: 1200 / 630;
  background: rgba(255, 255, 255, 0.05);
}

.preview-link-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-link-card-image-empty {
  background: rgba(255, 255, 255, 0.05);
}

.preview-link-card-icon {
  width: 100%;
  aspect-ratio: 1200 / 630;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
}

.preview-link-card-icon svg {
  width: 48px;
  height: 48px;
}

.preview-link-card-content {
  padding: 0.75rem;
}

.preview-link-card-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.preview-link-card-description {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* プレビュー 作品 */
.preview-works-section {
  /* margin-top は上部で統一定義 */
}

.preview-section-title {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
  text-align: center;
  font-weight: 400;
}

.preview-pickup-section {
  /* margin-top は上部で統一定義 */
}

.preview-works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.preview-work {
  aspect-ratio: 3 / 4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
}

.preview-work:hover {
  border-color: #7c3aed;
  transform: scale(1.05);
}

.preview-work img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-work-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.preview-work-icon svg {
  width: 32px;
  height: 32px;
}

/* 作品カードオーバーレイ */
.preview-work-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
  padding: 1.5rem 0.5rem 0.4rem;
  pointer-events: none;
}

.preview-work-overlay-title {
  font-size: 0.6rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.15rem 0;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-work-overlay-desc {
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* プレビュー内ドラッグ＆ドロップ */
.preview-link-card.draggable,
.preview-work.draggable {
  cursor: grab;
  user-select: none;
}

.preview-link-card.draggable:active,
.preview-work.draggable:active {
  cursor: grabbing;
}

.preview-link-card.dragging,
.preview-work.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.preview-link-card.drag-over,
.preview-work.drag-over {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.3);
}

.preview-links.drag-active .preview-link-card,
.preview-works.drag-active .preview-work {
  transition: transform 0.15s ease;
}

/* 画像調整ボタン */
.btn-image-adjust {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #374151;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-image-adjust:hover {
  background: #e2e8f0;
  border-color: #6366f1;
}

.btn-image-adjust svg {
  color: #94a3b8;
}

/* 画像調整モーダル */
.image-adjust-modal {
  max-width: 1000px !important;
}

.image-adjust-body {
  display: flex;
  gap: 1.5rem;
}

.image-adjust-left {
  flex: 1;
  min-width: 0;
}

.image-adjust-right {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.image-adjust-preview {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.image-adjust-preview canvas {
  max-width: 100%;
  max-height: 300px;
  border-radius: 4px;
}

.image-adjust-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

/* スマホモック（小サイズ） */
.phone-mockup-small {
  width: 220px;
  background: #000;
  border-radius: 30px;
  padding: 8px;
  box-shadow: 0 15px 30px -8px rgba(0, 0, 0, 0.5);
}

.phone-mockup-small .phone-notch {
  height: 24px;
  border-radius: 24px 24px 0 0;
}

.phone-mockup-small .phone-notch::after {
  width: 60px;
  height: 18px;
}

.phone-mockup-small .phone-screen {
  height: 380px;
  max-height: 380px;
}

.phone-mockup-small .phone-home-bar {
  height: 20px;
  border-radius: 0 0 24px 24px;
}

.phone-mockup-small .phone-home-bar::after {
  width: 80px;
  height: 4px;
}

.phone-mockup-small .preview-content {
  padding: 0.75rem;
}

.phone-mockup-small .preview-avatar {
  width: 48px;
  height: 48px;
}

.phone-mockup-small .preview-name {
  font-size: 0.9rem;
}

.phone-mockup-small .preview-bio {
  font-size: 0.7rem;
}

.phone-mockup-small .preview-section-title {
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
}

.phone-mockup-small .preview-link-card {
  border-radius: 8px;
}

.phone-mockup-small .preview-link-card-image {
  aspect-ratio: 1200 / 630;
}

.phone-mockup-small .preview-link-card-content {
  padding: 0.5rem;
}

.phone-mockup-small .preview-link-card-title {
  font-size: 0.7rem;
}

.phone-mockup-small .preview-link-card-description {
  font-size: 0.6rem;
}

.phone-mockup-small .preview-work {
  aspect-ratio: 3 / 4;
}

.phone-mockup-small .preview-blocks-section {
  margin-top: 1rem;
}

.phone-mockup-small .preview-blocks {
  display: flex;
  justify-content: center;
}

.phone-mockup-small .preview-block-item {
  width: 80px;
  aspect-ratio: 1 / 1;
}

@media (max-width: 900px) {
  .image-adjust-body {
    flex-direction: column;
  }

  .image-adjust-right {
    order: -1;
  }

  .phone-mockup-small {
    width: 180px;
  }

  .phone-mockup-small .phone-screen {
    height: 280px;
    max-height: 280px;
  }
}

@media (max-width: 600px) {
  .image-adjust-controls {
    grid-template-columns: 1fr;
  }
}

.adjust-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.adjust-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #374151;
}

.adjust-label {
  font-weight: 500;
}

.adjust-value {
  color: #94a3b8;
  font-size: 0.8rem;
  min-width: 40px;
  text-align: right;
}

.adjust-group input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 3px;
  cursor: pointer;
}

.adjust-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #7c3aed;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
}

.adjust-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.adjust-group input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #7c3aed;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* モーダル */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: #f8fafc;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #e2e8f0;
  color: #374151;
}

.modal-body {
  padding: 1.5rem;
}

/* 画像ソースタブ */
.image-source-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  border-color: #6366f1;
  color: #4f46e5;
}

.tab-btn.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.tab-content {
  min-height: 100px;
}

.ogp-fetch-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.ogp-status {
  font-size: 0.85rem;
  color: #64748b;
}

.ogp-status.loading {
  color: #6366f1;
}

.ogp-status.success {
  color: #10b981;
}

.ogp-status.error {
  color: #ef4444;
}

.link-card-image-preview {
  width: 100%;
  aspect-ratio: 1;  /* デフォルト1:1、インラインスタイルで上書き */
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.link-card-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 3タブ用 */
.image-source-tabs-3 {
  grid-template-columns: repeat(3, 1fr);
  display: grid;
}

/* アイコン選択 */
.icon-hint {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 0.75rem 0;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.5rem;
  background: #f8fafc;
  border-radius: 8px;
}

.icon-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0.5rem;
}

.icon-item:hover {
  border-color: #6366f1;
  background: #e2e8f0;
}

.icon-item.selected {
  border-color: #6366f1;
  background: #4f46e5;
}

.icon-item svg {
  width: 24px;
  height: 24px;
  color: #94a3b8;
}

.icon-item.selected svg {
  color: #fff;
}

.selected-icon-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
}

.selected-icon-preview span {
  font-size: 0.85rem;
  color: #64748b;
}

.icon-preview-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #6366f1;
  border-radius: 8px;
}

.icon-preview-box svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
}

/* SNSオプション */
.sns-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.sns-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
}

.sns-option:hover {
  border-color: #6366f1;
  color: #4f46e5;
}

.sns-option.selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
}

.sns-option span {
  font-size: 0.75rem;
  font-weight: 500;
}

/* アイコンオプション */
.icon-options {
  display: flex;
  gap: 0.5rem;
}

.icon-option {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-option:hover {
  border-color: #6366f1;
  color: #4f46e5;
}

.icon-option.selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

/* 作品画像アップロード */
.work-image-upload {
  position: relative;
  width: 50%;
  max-width: 200px;
  aspect-ratio: 3 / 4;
  background: #f8fafc;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
  margin: 0 auto;
}

.work-image-upload:hover {
  border-color: #6366f1;
}

.work-image-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ブロック画像アップロード - 1:1 */
.block-image-upload {
  position: relative;
  width: 50%;
  max-width: 200px;
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
  margin: 0 auto;
}

.block-image-upload:hover {
  border-color: #6366f1;
}

.block-image-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 作品画像アップロード（統一モーダル用） */
.work-image-upload {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 3 / 4;
  background: #f8fafc;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, aspect-ratio 0.3s;
  margin: 0 auto;
}

.work-image-upload:hover {
  border-color: #6366f1;
}

.work-image-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-image-upload .upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #64748b;
  gap: 0.5rem;
}

.work-image-upload .upload-placeholder svg {
  color: #475569;
}

.work-image-upload .upload-placeholder p {
  font-size: 0.85rem;
  margin: 0;
}

/* 作品モーダル OGP画像プレビュー 3:4比率 */
#workModal .ogp-image-adjuster {
  width: 50%;
  max-width: 200px;
  margin: 0 auto;
}

#workModal .ogp-image-container {
  aspect-ratio: 3 / 4;
}

/* Photostock選択グリッド */
.photostock-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.photostock-grid-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.photostock-grid-item:hover {
  border-color: #6366f1;
  transform: scale(1.02);
}

.photostock-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photostock-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #64748b;
}

.photostock-loading p {
  margin: 0.5rem 0 0 0;
}

.photostock-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #64748b;
}

.photostock-empty p {
  margin: 0;
}

.photostock-select-area {
  cursor: pointer;
}

/* Photostockモーダル（他のモーダルより上に表示・画面最大化） */
#photostockModal {
  z-index: 1100;
}

#photostockModal .modal-content {
  max-width: calc(100vw - 2rem);
  width: 100%;
  max-height: calc(100vh - 2rem);
  height: auto;
}

#photostockModal .photostock-grid {
  max-height: calc(100vh - 12rem);
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* レスポンシブ */
@media (max-width: 768px) {
  .workstock-container {
    padding: 1rem;
  }

  .workstock-content {
    grid-template-columns: 1fr;
  }

  .phone-mockup {
    width: 280px;
  }

  .phone-screen {
    height: 560px;
    max-height: 560px;
  }

  .sns-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .save-area {
    flex-direction: column;
  }

  .save-area-left {
    width: 100%;
  }
}

/* ========================================
   カスタムプロフィールエディタ
   ======================================== */

.custom-section {
  border-top: 1px dashed #d1d5db;
  padding-top: 1.5rem;
  margin-top: 1rem;
}

.custom-editor-container {
  margin-top: 1rem;
}

/* コードタブ */
.code-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0;
}

.code-tab {
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: #94a3b8;
  font-size: 0.85rem;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.2s;
}

.code-tab:hover {
  color: #fff;
  background: #f8fafc;
}

.code-tab.active {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #6366f1;
}

/* コードエディタ */
.code-editor-wrapper {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 0 8px 8px 8px;
  overflow: hidden;
}

.code-editor {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  background: #f8fafc;
  border: none;
  color: #374151;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
}

.code-editor:focus {
  outline: none;
}

.code-editor::placeholder {
  color: #475569;
}

/* ファイルサイズ表示 */
.code-info {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.file-size {
  font-size: 0.75rem;
  color: #64748b;
  font-family: monospace;
}

.file-size.warning {
  color: #f59e0b;
}

.file-size.error {
  color: #ef4444;
}

/* バリデーションエラー */
.validation-errors {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
}

.validation-errors .error-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ef4444;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.validation-errors .error-list {
  margin: 0;
  padding-left: 1.5rem;
  font-size: 0.85rem;
  color: #fca5a5;
}

.validation-errors .error-list li {
  margin-bottom: 0.25rem;
}

/* カスタムアクションボタン */
.custom-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.custom-actions button {
  flex: 1;
}

.btn-danger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #f87171;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: #dc2626;
  color: #fca5a5;
}

/* 設定タブ用スタイル */
.edit-section-danger {
  border-color: rgba(220, 38, 38, 0.3);
}

.edit-section-danger h2 {
  color: #f87171;
}

.edit-section-danger h2 svg {
  color: #f87171;
}

/* トグルスイッチ */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #e2e8f0;
  border-radius: 12px;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-label input:checked + .toggle-switch {
  background: #6366f1;
}

.toggle-label input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

.toggle-text {
  color: #374151;
  font-size: 0.95rem;
}

/* URL入力グループ */
.url-input-group {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.url-prefix {
  padding: 0.75rem;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.9rem;
  border-right: 1px solid #e2e8f0;
}

.url-input-group input {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.95rem;
}

.url-input-group input:focus {
  outline: none;
}

/* 統計情報テキスト */
.stats-info-text {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0;
}

/* 設定タブ用統計セクション */
.stats-details-settings {
  margin-top: 0.5rem;
}

.stats-period-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.period-tab {
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.period-tab:hover {
  border-color: #6366f1;
  color: #4f46e5;
}

.period-tab.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.stats-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.stats-total-label {
  color: #94a3b8;
  font-size: 0.9rem;
}

.stats-total-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #6366f1;
}

.stats-chart-settings {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tracking-links-list-settings {
  margin-top: 1rem;
}

/* 状態表示 */
.custom-status {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

.custom-status.deployed {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.custom-status.draft {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ヒントテキスト */
.hint {
  font-weight: normal;
  font-size: 0.8rem;
  color: #64748b;
}

/* ========================================
   カスタムAPIパネル
   ======================================== */

.btn-customize {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-customize:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-reset-template {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: #dc2626;
  border: 1px solid #dc2626;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset-template:hover:not(.disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-reset-template.disabled {
  background: transparent;
  border-color: #4b5563;
  color: #6b7280;
  cursor: not-allowed;
}

.custom-api-panel {
  margin-top: 1rem;
  padding: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.api-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.api-info-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.btn-copy-all {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #6366f1;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy-all:hover {
  background: #4f46e5;
}

.api-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .api-info-grid {
    grid-template-columns: 1fr;
  }
}

.api-info-item {
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
}

.api-info-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.api-info-item code {
  display: block;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.85rem;
  color: #374151;
  word-break: break-all;
}

.api-value-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.api-value-row code {
  flex: 1;
}

.btn-icon {
  padding: 0.375rem;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: #e2e8f0;
  color: #fff;
}

.btn-regenerate {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: transparent;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  color: #f59e0b;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-regenerate:hover {
  background: #f59e0b;
  color: #000;
}

/* curlセクション */
.api-curl-section {
  margin-bottom: 1.5rem;
}

.api-curl-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 1rem 0;
}

.curl-group {
  margin-bottom: 0.75rem;
}

.curl-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 0.375rem;
}

.curl-code {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  background: #f8fafc;
  border-radius: 6px;
  overflow: hidden;
}

.curl-code code {
  flex: 1;
  padding: 0.75rem;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.75rem;
  color: #94a3b8;
  word-break: break-all;
  line-height: 1.4;
}

.curl-code .btn-icon {
  border: none;
  border-radius: 0;
  background: #e2e8f0;
  padding: 0.5rem 0.75rem;
}

/* 注意事項 */
.api-notes {
  padding: 1rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
}

.api-notes p {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  color: #f59e0b;
}

.api-notes ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.8rem;
  color: #fcd34d;
}

.api-notes ul li {
  margin-bottom: 0.25rem;
}

/* 制限事項リスト */
.custom-limits {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(100, 116, 139, 0.1);
  border-radius: 8px;
  border-left: 3px solid #64748b;
}

.custom-limits-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}

.custom-limits ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.8rem;
  color: #374151;
}

.custom-limits ul li code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
  color: #60a5fa;
}

.custom-limits ul li {
  margin-bottom: 0.25rem;
}

.custom-limits ul li:last-child {
  margin-bottom: 0;
}

.custom-limits ul li strong {
  color: #f59e0b;
}

/* カスタマイズカード - ダークで存在感のあるスタイル */
.customize-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.customize-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.customize-card:hover {
  border-color: #2a2a2a;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.customize-card:hover::before {
  opacity: 1;
}

.customize-card-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.customize-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #3a3a3a;
  text-transform: uppercase;
  transition: color 0.3s;
}

.customize-card:hover .customize-card-label {
  color: #666;
}

.customize-card-content p {
  font-size: 0.8rem;
  color: #4a4a4a;
  margin: 0;
  transition: color 0.3s;
}

.customize-card:hover .customize-card-content p {
  color: #888;
}

.customize-card-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #2a2a2a;
  transition: all 0.3s;
}

.customize-card:hover .customize-card-arrow {
  color: #555;
  transform: translateX(4px);
}

/* btn-customize-action は不要（カード全体がクリッカブル） */

/* API情報モーダル */
.api-info-modal-body {
  padding: 0 !important;
}

.api-info-description {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.api-info-description p {
  color: #374151;
  font-size: 0.875rem;
  margin: 0 0 0.75rem 0;
  line-height: 1.5;
}

.api-info-description ul {
  margin: 0;
  padding-left: 1.25rem;
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.7;
}

.api-info-description li {
  margin-bottom: 0.25rem;
}

.api-info-description strong {
  color: #f59e0b;
  font-weight: 600;
}

/* API Modal Tabs */
.api-modal-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.api-modal-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.api-modal-tab:hover {
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.1);
}

.api-modal-tab.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}

.api-modal-tab-content {
  display: none;
}

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

.api-info-summary {
  padding: 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.api-info-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

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

.api-info-label {
  font-size: 0.8rem;
  color: #fff;
  width: 80px;
  flex-shrink: 0;
}

.api-info-row code {
  flex: 1;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.85rem;
  color: #374151;
  background: #f8fafc;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  word-break: break-all;
}

.btn-regenerate-small {
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  color: #f59e0b;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-regenerate-small:hover {
  background: #f59e0b;
  color: #000;
}

.api-copy-all-content {
  padding: 1rem 1.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.api-copy-all-content pre {
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #fff;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* モック下のカスタムセクション */
.custom-section-below-mock {
  margin-top: 1rem;
}

.custom-section-below-mock .customize-card {
  margin-bottom: 0.75rem;
}

.custom-section-below-mock .custom-status {
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .customize-card {
    flex-direction: column;
    text-align: center;
  }

  .btn-customize-action {
    width: 100%;
    justify-content: center;
  }

  .api-info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .api-info-label {
    width: auto;
  }

  .api-info-row code {
    width: 100%;
  }
}

/* ========================================
   アイコンSVG表示スタイル
   ======================================== */

/* SNSアイコンリストでのSVG表示 */
.sns-icon-svg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 8px;
}

.sns-icon-svg svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

.sns-icon-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  border-radius: 8px;
}

.sns-icon-placeholder svg {
  color: #64748b;
}

/* カスタムリンクカードでのアイコン表示 */
.link-card-icon {
  width: 100%;
  aspect-ratio: 1200 / 630;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.link-card-icon svg {
  width: 48px;
  height: 48px;
  color: #fff;
}

/* 作品でのアイコン表示 */
.work-icon-svg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.work-icon-svg svg {
  width: 48px;
  height: 48px;
  color: #fff;
}

/* プレビューでのアイコン表示 */
.preview-link-card-icon {
  width: 100%;
  aspect-ratio: 1200 / 630;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
}

.preview-link-card-icon svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

.preview-work-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
}

.preview-work-icon svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

/* ========================================
   OGP画像位置調整機能
   ======================================== */

.ogp-image-adjuster {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.ogp-image-container {
  width: 100%;
  aspect-ratio: 1200 / 630;
  overflow: hidden;
  cursor: grab;
  position: relative;
  touch-action: none;
}

.ogp-image-container:active {
  cursor: grabbing;
}

.ogp-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ドラッグ用オーバーレイ */
.ogp-image-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.ogp-adjust-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.75rem;
  text-align: center;
  pointer-events: none;
}

.ogp-image-adjuster {
  cursor: pointer;
}

.ogp-image-adjuster:hover .ogp-adjust-hint {
  background: rgba(99, 102, 241, 0.9);
}

/* ========================================
   OGP画像クロッパー（note風）
   ======================================== */

.cropper-modal-content {
  max-width: 800px;
  width: 95%;
}

.cropper-modal-body {
  padding: 1rem;
  background: #f8fafc;
}

.cropper-hint {
  color: #94a3b8;
  font-size: 0.875rem;
  margin: 0 0 1rem 0;
  text-align: center;
}

.cropper-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

/* 暗いオーバーレイ（上下） */
.cropper-overlay-top,
.cropper-overlay-bottom {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 5;
}

.cropper-overlay-top {
  top: 0;
}

.cropper-overlay-bottom {
  bottom: 0;
}

/* ドラッグ可能な画像 */
.cropper-image-wrapper {
  position: relative;
  width: 100%;
  cursor: grab;
  touch-action: none;
}

.cropper-image-wrapper:active {
  cursor: grabbing;
}

.cropper-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* 明るい領域のフレーム（視覚的な境界線） */
.cropper-frame-border {
  position: absolute;
  left: 0;
  right: 0;
  border: 3px solid #6366f1;
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
}

.cropper-frame-label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: #6366f1;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 11;
}

.cropper-drag-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 11;
  pointer-events: none;
}

/* ========================================
   リンクカード領域調整（2D対応）
   ======================================== */

/* 画像エディタモーダル（タブ付き） */
.image-editor-modal-content {
  max-width: 900px;
  width: 95%;
}

.image-editor-modal-body {
  padding: 1rem;
  background: #f8fafc;
}

/* 統合レイアウト（領域+補正を1画面） */
.image-editor-unified {
  display: flex;
  gap: 1.5rem;
}

.image-editor-cropper-section {
  flex: 1;
  min-width: 0;
}

.image-editor-controls-section {
  width: 200px;
  flex-shrink: 0;
}

.image-editor-controls-section .controls-hint {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.image-editor-controls-section .image-adjust-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.image-editor-controls-section .image-adjust-controls {
  flex: 1;
}

.image-adjust-phone-preview {
  margin-top: 0.5rem;
}

.image-adjust-phone-preview .controls-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.5rem;
}

/* ミニスマホモック */
.phone-mockup-mini {
  width: 120px;
  background: #000;
  border-radius: 16px;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin: 0 auto;
}

.phone-screen-mini {
  background: #1a1a2e;
  border-radius: 12px;
  height: 200px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-screen-mini .mini-preview-content {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.phone-screen-mini .mini-preview-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.phone-screen-mini .mini-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-screen-mini .mini-preview-name {
  font-size: 8px;
  color: #fff;
  opacity: 0.6;
}

.phone-screen-mini .mini-preview-image {
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.phone-screen-mini .mini-preview-image img {
  width: 100%;
  height: auto;
  display: block;
}

.phone-screen-mini .mini-preview-image.linkcard-ratio {
  aspect-ratio: 1200 / 630;
}

.phone-screen-mini .mini-preview-image.square-ratio {
  aspect-ratio: 1 / 1;
  max-width: 60px;
  margin: 0 auto;
}

.phone-screen-mini .mini-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ミニプレビュー 動画 */
.phone-screen-mini .mini-preview-video {
  width: 100%;
  border-radius: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  padding: 4px;
  margin-top: 4px;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
}

.phone-screen-mini .mini-preview-video-label {
  font-size: 8px;
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .image-editor-unified {
    flex-direction: column;
  }

  .image-editor-controls-section {
    width: 100%;
  }

  .image-editor-controls-section .image-adjust-body {
    flex-direction: row;
    align-items: flex-start;
  }

  .image-adjust-phone-preview {
    margin-top: 0;
  }
}

.image-editor-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.image-editor-controls .adjust-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.image-editor-controls .adjust-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #94a3b8;
}

.image-editor-controls .adjust-group input[type="range"] {
  width: 100%;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  align-self: flex-start;
  margin-top: 0.5rem;
}

.linkcard-cropper-container {
  position: relative;
  width: 100%;
  height: 400px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

/* 暗いオーバーレイ（上下左右） */
.linkcard-cropper-overlay-top,
.linkcard-cropper-overlay-bottom,
.linkcard-cropper-overlay-left,
.linkcard-cropper-overlay-right {
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 5;
}

.linkcard-cropper-overlay-top {
  top: 0;
  left: 0;
  right: 0;
}

.linkcard-cropper-overlay-bottom {
  bottom: 0;
  left: 0;
  right: 0;
}

.linkcard-cropper-overlay-left {
  left: 0;
}

.linkcard-cropper-overlay-right {
  right: 0;
}

/* ドラッグ可能な画像 */
.linkcard-cropper-image-wrapper {
  position: absolute;
  cursor: grab;
  touch-action: none;
  z-index: 1;
}

.linkcard-cropper-image-wrapper:active {
  cursor: grabbing;
}

.linkcard-cropper-image-wrapper img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* 明るい領域のフレーム */
.linkcard-cropper-frame {
  position: absolute;
  border: 3px solid #6366f1;
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
}

.linkcard-cropper-frame-label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: #6366f1;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 11;
}

.linkcard-cropper-drag-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 11;
  pointer-events: none;
}

/* ========================================
   ブロック領域調整（正方形、2Dドラッグ対応）
   ======================================== */

.block-cropper-container {
  position: relative;
  width: 100%;
  height: 400px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

/* 暗いオーバーレイ（上下左右） */
.block-cropper-overlay-top,
.block-cropper-overlay-bottom,
.block-cropper-overlay-left,
.block-cropper-overlay-right {
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 5;
}

.block-cropper-overlay-top {
  top: 0;
  left: 0;
  right: 0;
}

.block-cropper-overlay-bottom {
  bottom: 0;
  left: 0;
  right: 0;
}

.block-cropper-overlay-left {
  left: 0;
}

.block-cropper-overlay-right {
  right: 0;
}

/* ドラッグ可能な画像 */
.block-cropper-image-wrapper {
  position: absolute;
  cursor: grab;
  touch-action: none;
  z-index: 1;
}

.block-cropper-image-wrapper:active {
  cursor: grabbing;
}

.block-cropper-image-wrapper img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* 明るい領域のフレーム（正方形） */
.block-cropper-frame {
  position: absolute;
  border: 3px solid #6366f1;
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
}

.block-cropper-frame-label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: #6366f1;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 11;
}

.block-cropper-drag-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 11;
  pointer-events: none;
}

/* ========================================
   ギャラリー領域調整（正方形、2Dドラッグ対応）
   ======================================== */

.gallery-cropper-container {
  position: relative;
  width: 100%;
  height: 400px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

/* 暗いオーバーレイ（上下左右） */
.gallery-cropper-overlay-top,
.gallery-cropper-overlay-bottom,
.gallery-cropper-overlay-left,
.gallery-cropper-overlay-right {
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 5;
}

.gallery-cropper-overlay-top {
  top: 0;
  left: 0;
  right: 0;
}

.gallery-cropper-overlay-bottom {
  bottom: 0;
  left: 0;
  right: 0;
}

.gallery-cropper-overlay-left {
  left: 0;
}

.gallery-cropper-overlay-right {
  right: 0;
}

/* ドラッグ可能な画像 */
.gallery-cropper-image-wrapper {
  position: absolute;
  cursor: grab;
  touch-action: none;
  z-index: 1;
}

.gallery-cropper-image-wrapper:active {
  cursor: grabbing;
}

.gallery-cropper-image-wrapper img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* 明るい領域のフレーム（正方形） */
.gallery-cropper-frame {
  position: absolute;
  border: 3px solid #6366f1;
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
}

.gallery-cropper-frame-label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: #6366f1;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 11;
}

.gallery-cropper-drag-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 11;
  pointer-events: none;
}

/* ========================================
   URLチェック済バッジ
   ======================================== */

/* カスタムリンクのチェック済バッジ */
.url-checked-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 4px;
  color: #22c55e;
  font-size: 0.7rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.url-checked-badge svg {
  flex-shrink: 0;
}

/* 作品のチェック済バッジ（小さいアイコンのみ） */
.work-checked-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(34, 197, 94, 0.9);
  border-radius: 50%;
  color: #fff;
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.work-checked-badge svg {
  flex-shrink: 0;
}

/* ========================================
   トラッキングリンク一覧
   ======================================== */

.tracking-links-list {
  margin-top: 1rem;
}

.tracking-links-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tracking-link-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.tracking-link-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tracking-link-clicks {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  min-width: 60px;
}

.tracking-link-clicks-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #6366f1;
}

.tracking-link-clicks-label {
  font-size: 0.65rem;
  color: #64748b;
}

.tracking-link-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.tracking-link-item:hover .tracking-link-delete {
  opacity: 1;
}

.tracking-link-delete:hover {
  background: #dc2626;
}

.tracking-link-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tracking-link-type {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background: #6366f1;
  color: #fff;
  border-radius: 4px;
  font-weight: 500;
}

.tracking-link-title {
  font-size: 0.85rem;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracking-link-url {
  font-size: 0.75rem;
  color: #6366f1;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}

.tracking-link-url:hover {
  color: #818cf8;
  text-decoration: underline;
}

.tracking-link-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tracking-link-label {
  font-size: 0.7rem;
  color: #64748b;
  flex-shrink: 0;
  width: 40px;
}

.tracking-link-original-url {
  font-size: 0.75rem;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* メインSNS選択 */
.main-sns-selector {
  margin-bottom: 1.5rem;
}

.main-sns-label {
  display: block;
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.sns-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sns-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sns-option:hover {
  background: #e2e8f0;
  color: #374151;
}

.sns-option.selected {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.sns-option svg {
  flex-shrink: 0;
}

/* 計測URL生成ルール */
.tracking-rules {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.tracking-rules-header {
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.selected-sns-name {
  color: #3b82f6;
  font-weight: 600;
}

.tracking-rules-content {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.6;
}

.tracking-rules-content p {
  margin: 0 0 0.5rem 0;
}

.tracking-rules-content ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.tracking-rules-content li {
  margin-bottom: 0.25rem;
}

.tracking-rules-content code {
  background: #f8fafc;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8rem;
  color: #60a5fa;
}

.tracking-rules-content .example-url {
  display: block;
  background: #f8fafc;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin: 0.5rem 0;
  font-family: monospace;
  font-size: 0.8rem;
  color: #60a5fa;
  word-break: break-all;
}

/* Profile Setup Modal */
.profile-setup-modal-content {
  max-width: 500px;
  width: 90%;
}

.profile-setup-modal-body {
  padding: 1.5rem;
}

.profile-setup-description {
  color: #94a3b8;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.profile-setup-modal-body .form-group {
  margin-bottom: 1.25rem;
}

.profile-setup-modal-body .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.profile-setup-modal-body .form-group .required {
  color: #ef4444;
}

.profile-setup-modal-body .form-group .form-hint {
  color: #64748b;
  font-size: 0.8rem;
  margin: 0 0 0.75rem 0;
}

.profile-setup-modal-body .form-group input[type="text"],
.profile-setup-modal-body .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #374151;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-setup-modal-body .form-group input[type="text"]:focus,
.profile-setup-modal-body .form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.profile-setup-modal-body .form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* SNS Options Grid */
.sns-options-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.sns-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
}

.sns-option-btn:hover {
  background: #e2e8f0;
  color: #374151;
}

.sns-option-btn.selected {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.sns-option-btn svg {
  width: 24px;
  height: 24px;
}

.sns-option-btn span {
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.2;
}

@media (max-width: 600px) {
  .sns-options-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .sns-option-btn {
    padding: 0.5rem 0.25rem;
  }

  .sns-option-btn svg {
    width: 20px;
    height: 20px;
  }
}



/* ABテストモード */
.ab-test-section {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #3b82f6;
}

.ab-test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.ab-test-header h2 {
  margin-bottom: 0;
}

/* トグルスイッチ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #475569;
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #3b82f6;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* ABテストタブ */
.ab-test-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.ab-test-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  color: #94a3b8;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ab-test-tab:hover {
  background: #e2e8f0;
  color: #374151;
}

.ab-test-tab.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.ab-test-tab[data-variant="A"].active {
  background: #3b82f6;
  border-color: #3b82f6;
}

.ab-test-tab[data-variant="B"].active {
  background: #8b5cf6;
  border-color: #8b5cf6;
}

/* セクション追加モーダル */
.add-section-modal-content {
  max-width: 560px;
}

.add-section-description {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.section-type-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.section-type-cards-3 {
  grid-template-columns: repeat(3, 1fr);
}

#restoreSectionGroup {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.section-type-cards-4 {
  grid-template-columns: repeat(2, 1fr);
}

.section-type-card {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}

.section-type-card:hover {
  border-color: #6366f1;
  background: #f8fafc;
  transform: translateY(-2px);
}

.section-type-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  min-height: 80px;
}

/* ピックアップ - 縦3本のバー */
.section-type-vertical {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-type-vertical .preview-bar {
  width: 80%;
  height: 12px;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 4px;
  opacity: 0.8;
}

.section-type-vertical .preview-bar:nth-child(2) {
  opacity: 0.6;
}

.section-type-vertical .preview-bar:nth-child(3) {
  opacity: 0.4;
}

/* ギャラリー - 横3つの正方形 */
.section-type-horizontal {
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.section-type-horizontal .preview-square {
  width: 28px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 4px;
  opacity: 0.8;
}

.section-type-horizontal .preview-square:nth-child(2) {
  opacity: 0.6;
}

.section-type-horizontal .preview-square:nth-child(3) {
  opacity: 0.4;
}

/* ブロック - 2×2グリッド */
.section-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 28px);
  gap: 4px;
  justify-content: center;
}

.section-type-grid .preview-block {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 4px;
  opacity: 0.8;
}

.section-type-grid .preview-block:nth-child(2) {
  opacity: 0.7;
}

.section-type-grid .preview-block:nth-child(3) {
  opacity: 0.6;
}

.section-type-grid .preview-block:nth-child(4) {
  opacity: 0.5;
}

.section-type-info {
  text-align: center;
}

.section-type-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.25rem 0;
}

.section-type-info p {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
}

/* 無効なカード */
.section-type-card-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.section-type-card-disabled:hover {
  border-color: #e2e8f0;
  transform: none;
}

/* テキストセクションプレビュー */
.section-type-text {
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding: 1rem 1.25rem;
}

.preview-text-line {
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 4px;
  opacity: 0.6;
}

.preview-text-line-short {
  width: 60%;
  opacity: 0.4;
}

/* 動的セクションコンテナ */
#dynamicSections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#dynamicSections:not(:empty) {
  margin-top: 1.5rem;
}

/* 動的セクションの削除ボタン */
.section-delete-btn-remove {
  background: #dc2626;
  color: #fff;
}

.section-delete-btn-remove:hover {
  background: #b91c1c;
}


/* プレビューのプレースホルダースタイル */
.preview-link-card-placeholder,
.preview-work-placeholder {
  opacity: 0.5;
  pointer-events: none;
}

.preview-link-card-placeholder .placeholder-image,
.preview-work-placeholder .placeholder-image {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.preview-link-card-placeholder .preview-link-card-image {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
}

.placeholder-text {
  color: rgba(255, 255, 255, 0.6) !important;
}

.placeholder-text-small {
  color: rgba(255, 255, 255, 0.4) !important;
}

/* テキストセクション */
.text-section-content {
  width: 100%;
}

.text-section-textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
}

.text-section-textarea:focus {
  outline: none;
  border-color: #6366f1;
}

.text-section-textarea::placeholder {
  color: #64748b;
}

/* プレビュー用テキストセクション */
.preview-text-section {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  /* margin-top は上部で統一定義 */
}

.preview-text-content {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-text-content.placeholder-text {
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
}

/* テキストセクションプレビューラッパー */
.preview-text-section-wrap {
  /* margin-top は上部で統一定義 */
}

/* 動的セクションプレビュー */
.preview-dynamic-section {
  /* margin-top は上部で統一定義 */
}

/* プレビュー用ブロック */
.preview-blocks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  align-items: start;
}

.preview-block-item {
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 8px;
  overflow: hidden;
}

.preview-block-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========================================
   空白セクション
   ======================================== */

/* エディター側の空白セクション */
.spacer-section {
  padding: 1rem !important;
  padding-bottom: 3.5rem !important; /* 削除ボタン用のスペース確保 */
  min-height: auto !important;
}

.spacer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.spacer-type-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spacer-section-content {
  margin-top: 0.5rem;
}

/* 高さ調整コントロール */
.spacer-height-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(100, 116, 139, 0.1);
  border-radius: 6px;
}

.spacer-height-control label {
  font-size: 0.85rem;
  color: #94a3b8;
  white-space: nowrap;
}

.spacer-height-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 3px;
  cursor: pointer;
}

.spacer-height-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  transition: transform 0.15s;
}

.spacer-height-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.spacer-height-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
}

.spacer-preview {
  height: 80px;
  background: rgba(100, 116, 139, 0.05);
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 20px;
  max-height: 300px;
}
.spacer-preview.resizable {
  cursor: ns-resize;
}
.spacer-preview.resizing {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}

.spacer-label {
  color: #64748b;
  font-size: 0.85rem;
  user-select: none;
}

/* リサイズハンドル */
.spacer-resize-handle {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ns-resize;
  color: #64748b;
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
}
.spacer-resize-handle:hover {
  opacity: 1;
  color: #6366f1;
}
.spacer-preview.resizing .spacer-resize-handle {
  opacity: 1;
  color: #6366f1;
}

/* セクション追加モーダルの空白プレビュー */
.section-type-spacer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.preview-spacer-line {
  width: 60%;
  height: 3px;
  background: rgba(100, 116, 139, 0.3);
  border-radius: 2px;
}

/* プレビュー側の空白セクション */
.preview-spacer-section {
  margin: 0 !important;
}

.preview-spacer {
  height: 80px;
}

/* ========================================
   YouTubeセクション
   ======================================== */

/* エディター側のYouTubeセクション */
.youtube-section-content,
.video-section-content {
  margin-top: 0.5rem;
}

.youtube-url-input,
.video-url-input {
  width: 100%;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
}

.youtube-url-input:focus,
.video-url-input:focus {
  outline: none;
  border-color: #6366f1;
}

.youtube-preview-container,
.video-preview-container {
  margin-top: 1rem;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.youtube-preview-container iframe,
.video-preview-container iframe {
  width: 100%;
  height: 100%;
}

.youtube-placeholder,
.video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #64748b;
  text-align: center;
  padding: 0 1rem;
}

.youtube-placeholder p,
.video-placeholder p {
  font-size: 0.85rem;
  margin: 0;
}

/* セクション追加モーダルのYouTubeプレビュー */
.section-type-youtube {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #ef4444;
}

/* プレビュー側のYouTubeセクション */
.preview-youtube {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.preview-youtube iframe {
  width: 100%;
  height: 100%;
}

/* ========================================
   GIFセクション
   ======================================== */

/* セクション追加モーダルのGIFプレビュー */
.section-type-gif {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, #1e1e2e, #2d2d3d);
}

.gif-badge {
  font-size: 1rem;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border: 2px solid #10b981;
  border-radius: 4px;
}

/* エディター側のGIFセクション */
.gif-section-content {
  margin-top: 0.5rem;
}

.gif-upload-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: #f8fafc;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
}

.gif-upload-area:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.gif-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
}

.gif-placeholder p {
  font-size: 0.85rem;
  margin: 0;
}

.gif-preview-image {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
}

/* プレビュー側のGIFセクション */
#phonePreview .gif-section {
  padding: 0.75rem 0;
  margin-bottom: 4.5rem;
}

#phonePreview .gif-container {
  border-radius: 8px;
  overflow: hidden;
}

#phonePreview .gif-image {
  width: 100%;
  height: auto;
  display: block;
}

/* テキストセクション（編集エリア） */
.text-section-content {
  margin-top: 0.5rem;
}

.dynamic-text-input {
  width: 100%;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #374151;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 100px;
}

.dynamic-text-input:focus {
  outline: none;
  border-color: #6366f1;
}

.dynamic-text-input::placeholder {
  color: #64748b;
}

/* ========================================
   セクション並び替え
   ======================================== */

#sortableSections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title-static {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #000000;
}

.section-title-static svg {
  color: #6366f1;
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-move-buttons {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.section-move-btn {
  background: #fff;
  border: none;
  border-radius: 4px;
  color: #1e293b;
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.section-move-btn:hover {
  background: #6366f1;
  color: #fff;
  transform: scale(1.1);
}

.section-move-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.section-move-btn:disabled:hover {
  background: #fff;
  color: #1e293b;
  transform: none;
}

/* 移動アニメーション */
.sortable-section {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.sortable-section.moving {
  opacity: 0.7;
  transform: scale(0.98);
}

/* ========================================
   画像調整モーダル v2 レイアウト
   ======================================== */

.image-editor-layout-v2 {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  min-height: 400px;
}

/* V3レイアウト: 左に大きいクロッパー、右に補正コントロール */
.image-editor-layout-v3 {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 1.5rem;
  min-height: 400px;
}

.image-editor-cropper-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.image-editor-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  height: fit-content;
}

.adjust-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.adjust-group-vertical label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #94a3b8;
}

.adjust-group-vertical input[type="range"] {
  width: 100%;
}

.linkcard-cropper-container-large,
.block-cropper-container-large,
.gallery-cropper-container-large {
  width: 100%;
  height: 380px;
}

.image-editor-left-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.image-editor-controls-inline {
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.image-editor-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.adjust-group-inline {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 100px;
  flex: 1;
}

.adjust-group-inline label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #94a3b8;
}

.adjust-group-inline input[type="range"] {
  width: 100%;
  height: 4px;
}

.image-editor-controls-row .btn-sm {
  margin-left: auto;
  white-space: nowrap;
}

.image-editor-preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 大きいスマホモック */
.phone-mockup-large {
  width: 240px;
  height: 480px;
  background: #0a0a0f;
  border-radius: 30px;
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border: 3px solid #1e293b;
}

.phone-screen-large {
  width: 100%;
  height: 100%;
  background: #f8fafc;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.75rem;
}

@media (max-width: 800px) {
  .image-editor-layout-v2 {
    grid-template-columns: 1fr;
  }

  .image-editor-preview-panel {
    order: -1;
  }

  .phone-mockup-large {
    width: 180px;
    height: 360px;
  }

  .image-editor-layout-v3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .image-editor-controls-panel {
    order: 1;
  }

  .linkcard-cropper-container-large,
  .block-cropper-container-large,
  .gallery-cropper-container-large {
    height: 280px;
  }
}

/* ========================================
   ロールバックモーダル
   ======================================== */

.btn-rollback {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  border: 1px solid #475569;
  border-radius: 0.5rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-rollback:hover {
  border-color: #60a5fa;
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
}

.btn-rollback svg {
  width: 18px;
  height: 18px;
}

.rollback-modal-content {
  max-width: 480px;
  width: 90%;
}

.rollback-modal-body {
  padding: 1.5rem;
}

.rollback-description {
  color: #94a3b8;
  font-size: 0.875rem;
  margin: 0 0 1.5rem 0;
}

.rollback-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rollback-loading {
  text-align: center;
  color: #64748b;
  padding: 2rem;
}

.rollback-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.rollback-history-item:hover {
  border-color: #60a5fa;
  background: #1e3a5f;
}

.rollback-history-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rollback-history-generation {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.rollback-history-date {
  font-size: 0.75rem;
  color: #64748b;
}

.rollback-history-arrow {
  color: #64748b;
}

.rollback-history-item:hover .rollback-history-arrow {
  color: #60a5fa;
}

.rollback-empty {
  text-align: center;
  color: #64748b;
  padding: 2rem;
}

/* ロールバックプレビューモーダル */
.rollback-preview-modal-content {
  max-width: 500px;
  width: 95%;
  max-height: 90vh;
}

/* ナビゲーション付きコンテナ */
.rollback-nav-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.rollback-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #f8fafc;
  border: 1px solid #475569;
  border-radius: 50%;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.rollback-nav-btn:hover:not(:disabled) {
  border-color: #60a5fa;
  color: #60a5fa;
  background: #1e3a5f;
}

.rollback-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 履歴インジケーター */
.rollback-indicator {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.rollback-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #475569;
  transition: all 0.2s;
}

.rollback-indicator-dot.active {
  background: #60a5fa;
  transform: scale(1.2);
}

.rollback-preview-modal-content .modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.modal-back {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 0.375rem;
  color: #94a3b8;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-back:hover {
  border-color: #60a5fa;
  color: #60a5fa;
}

.rollback-preview-modal-content .modal-header h3 {
  flex: 1;
  margin: 0;
  font-size: 1rem;
}

.rollback-preview-body {
  display: flex;
  justify-content: center;
  padding: 1.5rem;
  background: #f8fafc;
}

.rollback-phone-mockup {
  position: relative;
  width: 240px;
  height: 480px;
  background: #f8fafc;
  border-radius: 2rem;
  padding: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.rollback-phone-mockup .phone-notch {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 20px;
  background: #f8fafc;
  border-radius: 0 0 1rem 1rem;
  z-index: 10;
}

.rollback-phone-mockup .phone-screen {
  width: 100%;
  height: 100%;
  background: #f8fafc;
  border-radius: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.rollback-preview-modal-content .modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.rollback-preview-modal-content .modal-footer .btn-secondary {
  flex: 1;
}

.rollback-preview-modal-content .modal-footer .btn-primary {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* プレビュー内のコンテンツスタイル（既存のphone-screenと同じ） */
.rollback-phone-mockup .preview-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
}

.rollback-phone-mockup .preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.rollback-phone-mockup .preview-scroll {
  position: relative;
  z-index: 1;
  padding: 3rem 1rem 1.5rem;
}

/* ===========================================
   モックプレビュー用CSS（u.htmlと同じスタイル）
   =========================================== */

/* プレビューコンテナ */
#phonePreview .profile-container {
  --bg-color: #0a0a0f;
  --card-bg: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --accent: #7c3aed;
  --accent-light: #a78bfa;

  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 0.75rem;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', sans-serif;
  line-height: 1.6;
  font-size: 12px;
}

/* サービスヘッダー */
#phonePreview .service-header {
  text-align: center;
  padding: 0.75rem 0;
  background: #000;
  margin: -1.5rem -0.75rem 1.5rem -0.75rem;
}

#phonePreview .service-name {
  font-family: 'Comfortaa', 'Quicksand', cursive;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

/* プロフィールヘッダー */
#phonePreview .profile-header {
  text-align: center;
  margin-bottom: 3rem;
}

#phonePreview .profile-avatar {
  width: var(--avatar-size, 70px);
  height: var(--avatar-size, 70px);
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  overflow: hidden;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#phonePreview .profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#phonePreview .profile-avatar svg {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
}

#phonePreview .profile-name {
  font-size: var(--font-title-size, 1.25rem);
  font-family: var(--font-title-family, inherit);
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--font-title-color, var(--text-primary));
}

#phonePreview .profile-bio {
  color: var(--font-body-color, var(--text-secondary));
  font-family: var(--font-body-family, inherit);
  font-size: var(--font-body-size, 0.9rem);
  line-height: 1.6;
  white-space: pre-wrap;
}

#phonePreview .profile-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

#phonePreview .profile-contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--font-accent-color, var(--text-secondary));
  font-size: 0.75rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

#phonePreview .profile-contact-link:hover {
  opacity: 0.8;
}

#phonePreview .profile-contact-link svg {
  flex-shrink: 0;
  opacity: 0.8;
}

/* セクション枠（全セクション統一） */
#phonePreview .profile-header,
#phonePreview .pickup-section,
#phonePreview .works-section,
#phonePreview .blocks-section,
#phonePreview .text-section,
#phonePreview .youtube-section,
#phonePreview .video-section,
#phonePreview .gif-section,
#phonePreview .spacer-section {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.02);
  /* inline style の background-color があればそちらが優先される */
}

/* セクション共通 */
#phonePreview .section-title {
  font-size: var(--font-section-size, 0.75rem);
  font-family: var(--font-section-family, inherit);
  color: var(--font-section-color, var(--text-secondary));
  margin-bottom: 0.75rem;
  text-align: center;
  font-weight: 500;
}

/* ピックアップセクション */
#phonePreview .pickup-section {
  margin-bottom: 3rem;
}

#phonePreview .pickup-section .section-title {
  flex-shrink: 0;
}

#phonePreview .link-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

#phonePreview .link-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

#phonePreview .link-card-image {
  width: 100%;
  aspect-ratio: 1;  /* デフォルト1:1、インラインスタイルで上書き */
  background: rgba(255, 255, 255, 0.05);
}

#phonePreview .link-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#phonePreview .link-card-content {
  padding: 0.5rem 0.75rem;
  background: var(--band-color, #000000);
}

#phonePreview .link-card-title {
  font-family: var(--font-title-family, inherit);
  color: var(--font-title-color, var(--text-primary));
  font-weight: 600;
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.125rem;
}

#phonePreview .link-card-description {
  font-family: var(--font-body-family, inherit);
  color: var(--font-body-color, var(--text-secondary));
  font-size: 0.7rem;
  line-height: 1.3;
  display: block;
}

/* ギャラリーセクション */
#phonePreview .works-section {
  margin-bottom: 3rem;
}

#phonePreview .works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.375rem;
}

#phonePreview .work-item {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

#phonePreview .work-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 空スロット（スペースを維持、枠なし） */
#phonePreview .work-item.work-item-empty {
  background: transparent;
  border: none;
}

#phonePreview .work-item .work-info {
  background: var(--band-color, #1e293b);
}

/* ブロックセクション */
#phonePreview .blocks-section {
  margin-bottom: 3rem;
}

#phonePreview .blocks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

#phonePreview .block-item {
  position: relative;
  aspect-ratio: 1 / 1 !important;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

#phonePreview .block-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 空スロット（スペースを維持、枠なし） */
#phonePreview .block-item.block-item-empty {
  background: transparent;
  border: none;
}

#phonePreview .block-info {
  background: var(--band-color, #1e293b);
}

/* テキストセクション */
#phonePreview .text-section {
  margin-bottom: 3rem;
}

#phonePreview .text-content {
  font-size: var(--font-body-size, 0.9rem);
  font-family: var(--font-body-family, inherit);
  color: var(--font-body-color, var(--text-secondary));
  line-height: 1.6;
  white-space: pre-wrap;
}

/* YouTubeセクション */
#phonePreview .youtube-section,
#phonePreview .video-section {
  margin-bottom: 3rem;
}

#phonePreview .youtube-embed,
#phonePreview .video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

#phonePreview .youtube-embed iframe,
#phonePreview .video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

#phonePreview .video-placeholder,
#phonePreview .youtube-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #64748b;
  text-align: center;
}

#phonePreview .video-placeholder p,
#phonePreview .youtube-placeholder p {
  font-size: 0.75rem;
  margin: 0;
}

/* スペーサーセクション */
#phonePreview .spacer-section {
  /* height is set via inline style */
}

/* フッター */
#phonePreview .profile-footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: 1rem;
}

#phonePreview .profile-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.7rem;
}

/* プレースホルダー */
#phonePreview .placeholder {
  background: linear-gradient(90deg, var(--card-bg) 25%, rgba(255,255,255,0.1) 50%, var(--card-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* 初期テンプレートに戻すボタン */
.btn-reset-template {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset-template:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.btn-reset-template svg {
  flex-shrink: 0;
}

/* 空セクションのプレースホルダー */
#phonePreview .empty-section {
  opacity: 0.5;
}

#phonePreview .empty-image {
  background: rgba(255, 255, 255, 0.05);
}

#phonePreview .empty-text {
  min-height: 6em;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

/* 保存エリアのボタン */
.save-area-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.btn-other-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-other-actions:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #64748b;
  color: #cbd5e1;
}

/* その他操作モーダル */
.modal-small {
  max-width: 400px;
}

.other-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.other-action-btn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #374151;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.other-action-btn:hover {
  background: #e2e8f0;
  border-color: #6366f1;
}

.other-action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.other-action-btn.danger:hover svg {
  stroke: #ef4444;
}

.other-action-btn svg {
  flex-shrink: 0;
}

.other-action-btn .action-description {
  width: 100%;
  font-size: 0.75rem;
  color: #64748b;
  margin-left: calc(20px + 0.75rem);
}

/* アバター選択エリア */
.avatar-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.avatar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.avatar-clickable {
  cursor: pointer;
  position: relative;
}

.avatar-clickable:hover {
  opacity: 0.8;
}

.avatar-change-link {
  font-size: 0.75rem;
  color: #6366f1;
  text-decoration: none;
}

.avatar-change-link:hover {
  text-decoration: underline;
}

.avatar-options {
  flex: 1;
  position: relative;
}

.btn-avatar-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-avatar-select:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #64748b;
  color: #cbd5e1;
}

.avatar-size-slider {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.avatar-size-slider label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.75rem;
}

.avatar-size-slider #avatarSizeLabel {
  color: #6366f1;
  font-weight: 600;
  font-size: 0.85rem;
}

.avatar-slider-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-slider-label {
  font-size: 0.75rem;
  color: #64748b;
  min-width: 24px;
  text-align: center;
}

.avatar-slider-container input[type="range"] {
  -webkit-appearance: none;
  flex: 1;
  height: 6px;
  background: linear-gradient(90deg, #c7d2fe, #a5b4fc, #c7d2fe);
  border-radius: 999px;
  cursor: pointer;
}

.avatar-slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, background 0.2s;
}

.avatar-slider-container input[type="range"]::-webkit-slider-thumb:hover {
  background: #818cf8;
  transform: scale(1.05);
}

.avatar-slider-container input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: #6366f1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: background 0.2s;
}

.avatar-options-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.avatar-options-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.avatar-option {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: #f8fafc;
}

.avatar-option:hover {
  border-color: #6366f1;
  transform: scale(1.1);
}

.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-options-empty {
  color: #64748b;
  font-size: 0.8rem;
  padding: 0.5rem;
  text-align: center;
  width: 100%;
}

/* ========================================
   背景画像クロッパーモーダル
   ======================================== */
.bg-cropper-modal-content {
  max-width: 900px;
  width: 95%;
}

.bg-cropper-modal-body {
  padding: 1rem;
}

.bg-cropper-layout {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.bg-cropper-section {
  flex: 1;
  min-width: 280px;
  max-width: 400px;
}

.bg-cropper-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.75rem 0;
  text-align: center;
}

.bg-cropper-container {
  position: relative;
  background: #0a0a0f;
  border-radius: 8px;
  overflow: hidden;
  cursor: grab;
}

.bg-cropper-container:active {
  cursor: grabbing;
}

.bg-cropper-horizontal {
  aspect-ratio: 1 / 1;
}

.bg-cropper-vertical {
  aspect-ratio: 1 / 1;
}

.bg-cropper-overlay-top,
.bg-cropper-overlay-bottom,
.bg-cropper-overlay-left,
.bg-cropper-overlay-right {
  position: absolute;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 2;
}

.bg-cropper-overlay-top {
  top: 0;
  left: 0;
  right: 0;
}

.bg-cropper-overlay-bottom {
  bottom: 0;
  left: 0;
  right: 0;
}

.bg-cropper-overlay-left {
  left: 0;
}

.bg-cropper-overlay-right {
  right: 0;
}

.bg-cropper-image-wrapper {
  position: absolute;
  z-index: 1;
}

.bg-cropper-image-wrapper img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.bg-cropper-frame-border {
  position: absolute;
  border: 2px solid #6366f1;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.bg-cropper-drag-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  pointer-events: none;
  z-index: 4;
  opacity: 0.8;
}

/* 背景画像表示領域オーバーレイ（横16:9と縦9:16を重ね合わせ） */
.bg-cross-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}

/* 横フレーム（16:9） */
.bg-frame {
  position: absolute;
  border: 2px dashed;
  box-sizing: border-box;
}

.bg-frame-horizontal {
  border-color: rgba(59, 130, 246, 0.8);
  background: rgba(59, 130, 246, 0.1);
}

.bg-frame-vertical {
  border-color: rgba(168, 85, 247, 0.8);
  background: rgba(168, 85, 247, 0.1);
}


/* ========================================
   十字クロッパー（画像固定・領域移動方式）
   ======================================== */
.bg-cross-cropper-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.bg-cross-cropper-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1 / 1;
  background: #0a0a0f;
  border-radius: 8px;
  overflow: hidden;
  cursor: grab;
}

.bg-cross-cropper-container:active {
  cursor: grabbing;
}

.bg-cross-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.bg-cross-overlay-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.bg-cross-frame-horizontal,
.bg-cross-frame-vertical {
  position: absolute;
  border: 2px dashed;
  pointer-events: none;
  z-index: 3;
  box-sizing: border-box;
}

.bg-cross-frame-horizontal {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.bg-cross-frame-vertical {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.bg-cross-drag-handle {
  position: absolute;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  background: rgba(99, 102, 241, 0.9);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: grab;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s, background 0.2s;
}

.bg-cross-drag-handle:hover {
  background: #6366f1;
  transform: translate(-50%, -50%) scale(1.1);
}

.bg-cross-drag-handle:active {
  cursor: grabbing;
  background: #4f46e5;
}

.bg-cross-drag-icon {
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

.bg-cross-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  font-size: 0.85rem;
  color: #94a3b8;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color {
  display: inline-block;
  width: 16px;
  height: 3px;
  border-radius: 2px;
}

.legend-color.horizontal {
  background: #3b82f6;
}

.legend-color.vertical {
  background: #f59e0b;
}

/* 編集セクションの画像クリック可能スタイル */
.link-card-image-clickable {
  cursor: pointer;
  position: relative;
  transition: opacity 0.2s;
}

.link-card-image-clickable:hover::after {
  content: '調整';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(99, 102, 241, 0.9);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  pointer-events: none;
}

.link-card-image-clickable:hover img {
  opacity: 0.7;
}

/* 編集中状態 */
.link-card-image-clickable.editing {
  opacity: 0.4;
  pointer-events: none;
}

.link-card-image-clickable.editing::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  margin-left: -12px;
  border: 2px solid #6366f1;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 10;
}

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

/* ========================================
   ロールバックプレビュー用スタイル
   #phonePreviewと同じスタイルを#rollbackPhonePreviewにも適用
   ======================================== */
#rollbackPhonePreview {
  --bg-color: #0a0a0f;
  --card-bg: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  padding: 1.5rem 0.75rem;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', sans-serif;
  line-height: 1.6;
  font-size: 12px;
}
#rollbackPhonePreview .service-header { text-align: center; padding: 0.5rem 0; background: #000; margin: -1.5rem -0.75rem 1rem -0.75rem; }
#rollbackPhonePreview .service-name { font-family: 'Comfortaa', 'Quicksand', cursive; font-size: 0.75rem; font-weight: 700; color: #fff; letter-spacing: 0.02em; }
#rollbackPhonePreview .profile-header { text-align: center; margin-bottom: 1.5rem; }
#rollbackPhonePreview .profile-avatar { width: var(--avatar-size, 70px); height: var(--avatar-size, 70px); border-radius: 50%; background: var(--card-bg); border: 2px solid var(--border-color); overflow: hidden; margin: 0 auto 0.75rem; display: flex; align-items: center; justify-content: center; }
#rollbackPhonePreview .profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
#rollbackPhonePreview .profile-avatar svg { width: 32px; height: 32px; color: var(--text-secondary); }
#rollbackPhonePreview .profile-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text-primary); }
#rollbackPhonePreview .profile-bio { color: var(--text-secondary); font-size: 0.8rem; white-space: pre-wrap; }
#rollbackPhonePreview .section-title { font-size: var(--font-section-size, 0.75rem); font-family: var(--font-section-family, inherit); color: var(--font-section-color, var(--text-secondary)); margin-bottom: 0.75rem; text-align: center; font-weight: 500; }
#rollbackPhonePreview .pickup-section { margin-bottom: 1.5rem; }
#rollbackPhonePreview .link-cards { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
#rollbackPhonePreview .link-card { display: flex; flex-direction: column; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; width: 100%; }
#rollbackPhonePreview .link-card-image { width: 100%; aspect-ratio: 1; background: rgba(255, 255, 255, 0.05); }
#rollbackPhonePreview .link-card-image img { width: 100%; height: 100%; object-fit: cover; }
#rollbackPhonePreview .link-card-content { padding: 0.5rem 0.75rem; }
#rollbackPhonePreview .link-card-title { color: var(--text-primary); font-weight: 600; font-size: 0.8rem; display: block; margin-bottom: 0.125rem; }
#rollbackPhonePreview .link-card-description { color: var(--text-secondary); font-size: 0.7rem; line-height: 1.3; display: block; }
#rollbackPhonePreview .works-section { margin-bottom: 1.5rem; }
#rollbackPhonePreview .works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.375rem; }
#rollbackPhonePreview .work-item { aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; background: var(--card-bg); border: 1px solid var(--border-color); }
#rollbackPhonePreview .work-item img { width: 100%; height: 100%; object-fit: cover; }
#rollbackPhonePreview .blocks-section { margin-bottom: 1.5rem; }
#rollbackPhonePreview .blocks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}
#rollbackPhonePreview .block-item { aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: var(--card-bg); border: 1px solid var(--border-color); display: block; }
#rollbackPhonePreview .block-item img { width: 100%; height: 100%; object-fit: cover; }
#rollbackPhonePreview .block-title { position: absolute; bottom: 0; left: 0; right: 0; padding: 0.25rem 0.5rem; background: rgba(0,0,0,0.6); color: #fff; font-size: 0.625rem; text-align: center; }
#rollbackPhonePreview .text-section { margin-bottom: 1.5rem; }
#rollbackPhonePreview .text-content { font-size: var(--font-body-size, 0.8rem); font-family: var(--font-body-family, inherit); color: var(--font-body-color, var(--text-secondary)); line-height: 1.5; white-space: pre-wrap; }
#rollbackPhonePreview .youtube-section,
#rollbackPhonePreview .video-section { margin-bottom: 1.5rem; }
#rollbackPhonePreview .youtube-embed,
#rollbackPhonePreview .video-embed { position: relative; width: 100%; padding-bottom: 56.25%; border-radius: 6px; overflow: hidden; background: #000; }
#rollbackPhonePreview .gif-section { margin-bottom: 1.5rem; }
#rollbackPhonePreview .gif-container { border-radius: 8px; overflow: hidden; }
#rollbackPhonePreview .gif-image { width: 100%; height: auto; display: block; }

/* モックダウンロードボタン */
.mockup-download-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s;
  z-index: 10;
  opacity: 0.7;
}
.mockup-download-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  background: #6366f1;
}
/* モック共有ボタン */
.mockup-share-btn {
  position: absolute;
  bottom: 8px;
  right: 48px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s;
  z-index: 10;
  opacity: 0.7;
}
.mockup-share-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  background: #22c55e;
}
.mockup-share-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.phone-mockup {
  position: relative;
}
.rollback-phone-mockup {
  position: relative;
}

/* ====================================
   ブログ機能スタイル
   ==================================== */

/* 記事一覧 */
.blog-posts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog-post-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}

.blog-post-item:hover {
  border-color: #6366f1;
}

.blog-post-thumbnail {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}

.blog-post-thumbnail-placeholder {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #64748b;
}

.blog-post-info {
  flex: 1;
  min-width: 0;
}

.blog-post-title {
  font-weight: 600;
  color: #f1f5f9;
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #64748b;
}

.blog-post-status {
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

.blog-post-status.published {
  background: #065f46;
  color: #6ee7b7;
}

.blog-post-status.draft {
  background: #78350f;
  color: #fcd34d;
}

.blog-post-actions {
  display: flex;
  gap: 0.5rem;
}

.blog-post-actions button {
  padding: 0.5rem;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
}

.blog-post-actions button:hover {
  background: #e2e8f0;
  color: #f1f5f9;
}

.blog-post-actions button.delete:hover {
  background: #7f1d1d;
  border-color: #dc2626;
  color: #fca5a5;
}

/* ブログ画像アップロード */
.blog-image-upload {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 200px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: #f8fafc;
}

.blog-image-upload:hover {
  border-color: #6366f1;
}

.blog-image-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* マークダウンエディターツールバー */
.blog-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

.blog-editor-toolbar button {
  padding: 0.4rem 0.6rem;
  background: #e2e8f0;
  border: none;
  border-radius: 4px;
  color: #374151;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 32px;
}

.blog-editor-toolbar button:hover {
  background: #6366f1;
  color: white;
}

#blogPostContent {
  border-radius: 0 0 8px 8px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* モーダル large バリエーション */
.modal-content-large {
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
}

/* フォーム行（横並び） */
.form-row {
  display: flex;
  gap: 1rem;
}

.form-group-half {
  flex: 1;
}

/* フォームヒント */
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* 必須マーク */
.required {
  color: #ef4444;
}

/* 空状態 */
.blog-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}

.blog-empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.blog-empty-state p {
  margin: 0;
  font-size: 0.95rem;
}

/* ブログプレビュー（モック内表示） */
.blog-preview-section {
  padding: 1rem 0.75rem;
}

.blog-preview-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog-preview-item {
  display: flex;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.75rem;
  transition: background 0.2s;
}

.blog-preview-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.blog-preview-image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.blog-preview-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.blog-preview-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-preview-excerpt {
  font-size: 0.7rem;
  color: #94a3b8;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-preview-date {
  font-size: 0.65rem;
  color: #64748b;
}

/* v20251214-blog */

/* ブログビュー切り替え */
.blog-view {
  display: none;
}

.blog-view.active {
  display: block;
}

/* セクションヘッダー行 */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-header-row h2 {
  margin: 0;
}

.section-header-row .section-description {
  margin: 0.25rem 0 0 0;
}

/* ブログ記事グリッド（3:4比率） */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.blog-post-card {
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.blog-post-card:hover {
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.blog-post-card-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #e2e8f0;
  position: relative;
  overflow: hidden;
}

.blog-post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-post-card-image .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.blog-post-card-status {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
}

.blog-post-card-status.published {
  background: rgba(6, 95, 70, 0.9);
  color: #6ee7b7;
}

.blog-post-card-status.draft {
  background: rgba(120, 53, 15, 0.9);
  color: #fcd34d;
}

.blog-post-card-content {
  padding: 0.75rem;
}

.blog-post-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0 0 0.25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-post-card-date {
  font-size: 0.7rem;
  color: #64748b;
}

/* 新規作成カード */
.blog-post-card-new {
  background: transparent;
  border: 2px dashed #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.blog-post-card-new:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
}

.blog-post-card-new-content {
  text-align: center;
  color: #64748b;
}

.blog-post-card-new-content svg {
  width: 32px;
  height: 32px;
  margin-bottom: 0.5rem;
}

.blog-post-card-new-content span {
  display: block;
  font-size: 0.85rem;
}

/* 戻るボタン */
.btn-back {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: #f1f5f9;
}

/* 編集ビューのヘッダー */
#blogEditView .section-header-row {
  align-items: center;
}

#blogEditView .section-header-row h2 {
  flex: 1;
}

/* ブログ編集アクション */
.blog-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

/* アイキャッチ画像アップロード */
.blog-eyecatch-upload {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 200px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  transition: all 0.2s;
}

.blog-eyecatch-upload:hover {
  border-color: #6366f1;
}

.blog-eyecatch-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-eyecatch-upload .upload-placeholder {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
}

.blog-eyecatch-upload .upload-placeholder span {
  font-size: 0.85rem;
}

/* 小さいボタン */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}


/* 編集バッジ */
.image-edit-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: #6366f1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}
.image-edit-badge:hover {
  background: #4f46e5;
  transform: scale(1.1);
}
.image-edit-badge svg {
  color: #fff;
}
/* 旧contain-mode/crop-modeスタイルは削除済み - 1:1固定アスペクト比を使用 */



/* ブログ公開/非公開トグルボタン */
.btn-publish {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.btn-publish.published {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.btn-publish.published:hover {
  background: rgba(34, 197, 94, 0.25);
}
.btn-publish.draft {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.btn-publish.draft:hover {
  background: rgba(251, 191, 36, 0.25);
}
.btn-publish .icon-published,
.btn-publish .publish-text {
  display: none;
}
.btn-publish .icon-draft,
.btn-publish .draft-text {
  display: inline;
}
.btn-publish.published .icon-published,
.btn-publish.published .publish-text {
  display: inline;
}
.btn-publish.published .icon-draft,
.btn-publish.published .draft-text {
  display: none;
}



/* 切り抜きズームコントロール */
.crop-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
}
.crop-zoom-controls label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: nowrap;
}
.crop-zoom-controls input[type=range] {
  flex: 1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}
.crop-zoom-controls input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #6366f1;
  border-radius: 50%;
  cursor: pointer;
}
.crop-zoom-controls span {
  font-size: 0.75rem;
  color: #64748b;
  min-width: 40px;
  text-align: right;
}
.crop-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0.25rem 0 0;
  text-align: center;
}
/* 旧crop-modeスタイルは削除済み - crop-editingを使用 */

/* 画像エディター横並びレイアウト */
.link-card-image-editor {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.link-card-image-editor .link-card-image-upload {
  flex: 1;
  min-width: 0;
}

/* 縦向きスライダー */
.image-adjust-slider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f8fafc;
  border-radius: 8px;
  min-width: 50px;
}
.image-adjust-slider input[type="range"] {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 24px;
  height: 150px;
  appearance: none;
  background: #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
}
.image-adjust-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: #6366f1;
  border-radius: 50%;
  cursor: pointer;
}
.image-adjust-slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #6366f1;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
.image-adjust-slider span {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 500;
}
.image-adjust-slider .slider-hint {
  font-size: 0.65rem;
  color: #64748b;
  margin: 0;
  text-align: center;
  white-space: nowrap;
}
.image-adjust-slider .slider-label {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* 切り抜きオーバーレイ */
.crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}
.crop-mask {
  position: absolute;
  background: rgba(0, 0, 0, 0.6);
}
.crop-mask-top {
  top: 0;
  left: 0;
  right: 0;
}
.crop-mask-bottom {
  bottom: 0;
  left: 0;
  right: 0;
}
.crop-mask-left {
  left: 0;
}
.crop-mask-right {
  right: 0;
}
.crop-area {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  cursor: move;
  pointer-events: auto;
}
.crop-area::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50%;
}
/* 切り抜きモード時の画像コンテナ */
.link-card-image-upload.crop-editing {
  cursor: default;
}
.link-card-image-upload.crop-editing img {
  cursor: default;
}

/* リンクカード画像コンテナ - 3:2固定 */
.link-card-image-upload {
  aspect-ratio: 3 / 2 !important;
  max-width: 360px;
  width: 100%;
}
.link-card-image-upload img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}


/* Item band for gallery and blocks in preview */
.works-grid .work-item,
.blocks-grid .block-item {
  position: relative;
  overflow: hidden;
}

.item-band {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px 12px 8px 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #fff;
  background: var(--band-color, #1e293b);
}

.item-band .item-title {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-band .item-description {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#phonePreview .link-card-content {
  padding: 0.5rem 0.75rem;
  background: var(--band-color, #000000);
}

#phonePreview .work-item .work-info {
  background: var(--band-color, #000000);
}

#phonePreview .block-info {
  background: var(--band-color, #000000);
}
/* Light theme update $(date +%s) */

/* セクションアイテムラッパー - リンク入力欄用 */
.section-item-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item-link-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.item-link-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.item-link-input::placeholder {
  color: #94a3b8;
}

