/* creative copy boost - デザインシステム ＆ スタイリング */

:root {
  --bg-color: #f3f1f8; /* Meta広告管理画面のライトグレー背景 */
  --panel-bg: #ffffff; /* 純白カードパネル */
  --panel-border: #d8d2e5; /* 落ち着いたボーダーグレー */
  --text-main: #2f2938; /* Meta標準のプライマリテキスト（黒） */
  --text-muted: #6f6878; /* セカンダリテキスト（グレー） */
  --primary-color: #5a478f; /* Metaブルー */
  --primary-grad: linear-gradient(135deg, #3f2f74 0%, #5a478f 52%, #9b89c8 100%); /* フラットカラー */
  --accent-color: #4b396f; /* 警告用ゴールド */
  --success-color: #168f70; /* Metaアクティブグリーン */
  --danger-color: #f02849; /* Metaエラーレッド */
  --radius-lg: 12px; /* シャープでプロフェッショナルな角丸 */
  --radius-md: 8px;
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.05); /* フラットな影 */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, 'Noto Sans JP', sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  overflow-y: auto; /* 全体の縦スクロールを許可 */
}

.app-container {
  width: 100%;
  max-width: 1700px; /* 画面を広く使うために拡張 */
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ヘッダー - 広告マネージャ風のフラットバー */
.app-header {
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 8px;
  margin-bottom: 0px;
}

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

.logo-icon {
  font-size: 28px;
  color: var(--primary-color);
  font-weight: 800;
  line-height: 1;
}

.site-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.auth-header .site-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  animation: float 3s ease-in-out infinite;
}

.header-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #ebe6f2;
  border: 1px solid rgba(90, 71, 143, 0.2);
  color: var(--primary-color);
  font-weight: 600;
}

.header-desc {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

/* メインレイアウト - 左右余白を活かした3カラム構成 */
.app-main {
  display: grid;
  grid-template-columns: 350px 1fr 1fr; /* 入力: 350px, プレビュー: 1fr, 設定: 1fr で同じ幅にする */
  gap: 16px;
  align-items: stretch; /* すべてのカラムの高さを綺麗に揃える */
}

@media (max-width: 1100px) {
  .app-main {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  .app-main {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* パネル基本スタイル */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 各カラムの高さ調整設定 */
.input-panel,
.preview-column-panel,
.style-panel {
  height: 100%; /* すべてのパネルを高さいっぱいに伸ばして下端を揃える */
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-section h2 {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f0f2f5;
  padding-bottom: 8px;
}

.step-num {
  background: var(--primary-color);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.brand-logo-panel {
  margin-top: 6px; padding: 12px; border: 1px solid var(--panel-border);
  border-radius: var(--radius-md); background: #f8f9fa;
}

.brand-logo-heading, .logo-settings {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.brand-logo-heading label { display: block; font-size: 12px; font-weight: 700; }
.brand-logo-heading p { margin-top: 2px; color: var(--text-muted); font-size: 10px; }

.logo-upload-zone {
  width: 100%; min-height: 58px; margin-top: 10px;
  border: 1px dashed #aeb4bd; border-radius: var(--radius-md);
  background: #fff; color: var(--primary-color); font: inherit;
  font-size: 12px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

.logo-upload-zone:hover { border-color: var(--primary-color); background: #f0edf6; }
.logo-upload-icon { font-size: 20px; }
#logoThumbnail {
  width: 64px; height: 40px; object-fit: contain; border-radius: 4px;
  background-image: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 10px 10px; background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}
.logo-settings { margin-top: 10px; align-items: flex-end; }
.logo-settings .input-group { flex: 1; }
.btn-logo-remove { border: 0; background: transparent; color: var(--danger-color); font-size: 11px; cursor: pointer; }

/* アップロードゾーン */
.upload-zone {
  border: 2px dashed var(--panel-border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f8f9fa;
  position: relative;
  overflow: hidden;
}

.upload-zone:hover {
  border-color: var(--primary-color);
  background: #f0edf6;
}

.upload-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.upload-text-main {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.upload-text-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* アップロード後のファイル表示 */
.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f0f2f5;
  border: 1px solid var(--panel-border);
  padding: 10px;
  border-radius: var(--radius-md);
}

.file-icon {
  font-size: 20px;
}

.file-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-grow: 1;
  min-width: 0;
}

.file-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.file-size {
  font-size: 11px;
  color: var(--text-muted);
}

/* ボタン関係 */
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-icon:hover {
  background: #e4e6eb;
  color: var(--danger-color);
}

/* テキスト入力エリア */
textarea {
  width: 100%;
  height: 90px;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  line-height: 1.4;
  transition: all 0.2s;
}

textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(90, 71, 143, 0.2);
}

.helper-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -2px;
}

/* スタイルグリッド */
.style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-group input[type="number"] {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  transition: all 0.2s;
}

.input-group input[type="number"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(90, 71, 143, 0.2);
}

/* カラーピッカーのラッパー */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  height: 34px;
}

.color-picker-wrapper input[type="color"] {
  border: 1px solid #ddd;
  background: transparent;
  width: 24px;
  height: 24px;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
}

.color-code {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-main);
  text-transform: uppercase;
}

/* スタイル行・範囲入力 */
.style-row {
  display: flex;
  gap: 10px;
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.range-inputs input[type="number"] {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 6px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  text-align: center;
  transition: all 0.2s;
}

.range-inputs input[type="number"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(90, 71, 143, 0.2);
}

/* 位置コントロール */
.position-controls {
  background: #f8f9fa;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.position-controls label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.position-grid {
  display: flex;
  gap: 12px;
}

.input-group-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.input-group-inline input {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  width: 60px;
  text-align: center;
  transition: all 0.2s;
}

.input-group-inline input:focus:not([readonly]) {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(90, 71, 143, 0.2);
}

.input-group-inline input[readonly] {
  color: var(--text-muted);
  background: #e4e6eb;
  border-color: #ccd0d5;
}

/* メインボタン - 広告マネージャの実行ボタン風 */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background: var(--primary-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover:not(:disabled) {
  background: #4b396f;
}

.btn-primary:active:not(:disabled) {
  background: #0b6173;
  transform: translateY(0);
}

.btn:disabled {
  background: #e4e6eb;
  color: #bcc0c4;
  box-shadow: none;
  cursor: not-allowed;
}

/* 右ペイン: プレビューエリア */
.preview-panel {
  flex-grow: 1;
}

.preview-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.preview-canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 450px; /* プレビューの視認性をさらに高めた最大幅 */
  max-height: 800px; /* プレビュー画面が見やすくなる最適な高さ制限 */
  aspect-ratio: 9/16;
  background: #1c1e21; /* クリエイティブが映えるディープグレー背景 */
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--panel-border);
  margin: 0 auto;
}

#previewCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#previewCanvas:active {
  cursor: grabbing;
}

.preview-overlay-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  pointer-events: none;
  background: rgba(28, 30, 33, 0.85);
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  width: 80%;
}

/* シークバー */
.seek-control {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 450px; /* プレビューの実幅に合わせて中央揃えにする */
  background: #f8f9fa;
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  margin: 0 auto;
}

.time-label {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-muted);
  width: 34px;
}

#seekSlider {
  flex-grow: 1;
  accent-color: var(--primary-color);
  background: #ccd0d5;
  height: 4px;
  border-radius: 2px;
  cursor: pointer;
}

.btn-play-pause {
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding-left: 2px; /* 再生アイコン（▶）を中央寄りに調整 */
}

.btn-play-pause.playing {
  background: var(--text-main);
  padding-left: 0; /* 一時停止アイコン（⏸）用の中央リセット */
}

.btn-play-pause:hover:not(:disabled) {
  background: #4b396f;
  transform: scale(1.05);
}

.btn-play-pause.playing:hover:not(:disabled) {
  background: #333333;
}

.btn-play-pause:active:not(:disabled) {
  transform: scale(0.95);
}

.btn-play-pause:disabled {
  background: #ccd0d5;
  color: #bcc0c4;
  cursor: not-allowed;
}


/* プログレスカード */
.progress-card {
  background: #f8f9fa;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-status-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.progress-count {
  font-size: 12px;
  font-family: monospace;
  color: var(--text-muted);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: #ccd0d5;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 3px;
  transition: width 0.2s ease;
  position: relative;
}

.current-processing-info {
  font-size: 11px;
  color: var(--accent-color);
  font-weight: 600;
}

.output-list-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 6px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 4px;
}

.output-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}

.output-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid var(--panel-border);
  transition: all 0.15s;
}

.output-item:hover {
  background: #f0f2f5;
  border-color: #ccd0d5;
}

.output-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  background: #ebe6f2;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-download:hover {
  background: var(--primary-color);
  color: #fff;
}

/* フォント検索入力欄 */
.font-search-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  transition: all 0.2s;
  margin-bottom: 6px;
}

.font-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(90, 71, 143, 0.2);
}

.font-search-input::placeholder {
  color: var(--text-muted);
}

/* ビジュアルフォントセレクター */
.font-selector-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 6px;
  background: #f8f9fa;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* スクロールバーのカスタマイズ (ライトテーマ用) */
.font-selector-container::-webkit-scrollbar {
  width: 6px;
}
.font-selector-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.font-selector-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.font-selector-container::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.font-card {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--panel-border);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.font-card:hover {
  background: #f0f2f5;
  border-color: #ccd0d5;
}

/* 選択中のカード：広告マネージャ風の爽やかなブルー配色 */
.font-card.active {
  background: #ebe6f2;
  border-color: var(--primary-color);
  border-width: 1px;
}

.font-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.font-card-name {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* 選択中のカードのテキストカラーをMetaブルーに */
.font-card.active .font-card-name {
  color: var(--primary-color);
}

.font-card-badge {
  font-size: 9px;
  background: #fff0d4;
  color: #a05a00;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  border: 1px solid rgba(228, 161, 27, 0.2);
}

/* テキストが見やすいようにカラーを白から黒へ */
.font-card-preview {
  font-size: 18px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 0;
}

.font-card.active .font-card-preview {
  color: #002d7a;
  font-weight: 600;
}

.font-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.btn-font-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px dashed var(--panel-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-font-action:hover {
  background: #f0f2f5;
  border-color: #ccd0d5;
  color: var(--text-main);
}

.btn-font-action:active {
  background: #e4e6eb;
}

.btn-font-upload {
  background: #ebe6f2;
  border: 1px solid rgba(90, 71, 143, 0.2);
  color: var(--primary-color);
}

.btn-font-upload:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

.btn-font-upload:active {
  background: #0b6173;
}

/* お気に入り（スター）ボタンのスタイル */
.font-card-fav-btn {
  background: none;
  border: none;
  color: #ccd0d5; /* 通常は薄いグレーの星 */
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
  margin-left: auto; /* メタ情報の右端に寄せる */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
  border-radius: 4px;
}

.font-card-fav-btn:hover {
  color: #ffb300; /* ホバー時はゴールド */
  background-color: rgba(255, 179, 0, 0.1);
  transform: scale(1.15);
}

.font-card-fav-btn.active {
  color: #ffb300; /* お気に入り登録時は星マークをゴールドに */
}

.font-card-fav-btn.active:hover {
  background-color: rgba(255, 179, 0, 0.15);
}

/* お気に入り登録されているカード自体のスタイル */
.font-card.favored {
  border-left: 3px solid #ffb300; /* 左側にゴールド of ワンポイント線 */
}

/* ==========================================
   ユーザー認証画面 (ログイン・登録フォーム)
   ========================================== */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
}

.auth-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header .logo-icon {
  font-size: 40px;
  color: var(--primary-color);
  font-weight: 800;
  display: inline-block;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

.auth-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.15s;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ヘッダーのログインステータス */
.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.user-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.user-icon {
  font-size: 14px;
}

.user-email-display {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.btn-logout {
  background: #f0f2f5;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: var(--danger-color);
  color: #ffffff;
  border-color: var(--danger-color);
}

/* ==========================================
   作成履歴テーブル
   ========================================== */
.history-section {
  margin-top: 12px;
  width: 100%;
}

.history-table-wrapper {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  overflow-y: auto;
  max-height: 180px; /* 履歴が多くなっても画面を突き抜けないように */
  background: #ffffff;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.history-table th,
.history-table td {
  padding: 12px 16px;
  font-size: 13px;
}

.history-table th {
  background: #f8f9fa;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--panel-border);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.history-table td {
  border-bottom: 1px solid #f0f2f5;
  color: var(--text-main);
  vertical-align: middle;
}

.history-table tr:last-child td {
  border-bottom: none;
}

.history-table tbody tr:hover {
  background: #fcfdfe;
}

.history-table .no-data {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  font-style: italic;
}

.btn-table-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ebe6f2;
  color: var(--primary-color);
  border: 1px solid rgba(90, 71, 143, 0.2);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  margin: 0 auto;
}

.btn-table-download:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(90, 71, 143, 0.2);
}

.btn-table-download:active {
  background: #0b6173;
  transform: translateY(1px);
}

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

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

/* アニメーション & シャドウ調整パネル用スタイル */
#animationType {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  transition: all 0.2s;
  cursor: pointer;
}

#animationType:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(90, 71, 143, 0.2);
}

.shadow-settings-panel {
  transition: background-color 0.2s ease;
}

.shadow-controls-grid.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* 操作防止シールドオーバーレイのスタイル */
.control-panel {
  position: relative;
}

.panel-shield {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85); /* 半透明の白で隠す */
  backdrop-filter: blur(2px); /* グラスモフィズムぼかし */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: var(--radius-lg);
  animation: fadeIn 0.2s ease;
}

.shield-content {
  text-align: center;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  max-width: 85%;
}

.shield-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 12px;
  animation: float 2s infinite ease-in-out;
}

.shield-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.5;
}

/* 処理状況インジケーターを操作防止シールド（z-index: 9999）の前面に浮かび上がらせる */
.progress-section {
  position: relative;
  z-index: 10000;
}


/* ==========================================
   JOYORO brand theme
   ========================================== */
body {
  background:
    radial-gradient(circle at 8% 0%, rgba(155, 137, 200, 0.24), transparent 28%),
    radial-gradient(circle at 100% 12%, rgba(90, 71, 143, 0.14), transparent 30%),
    linear-gradient(180deg, #faf9fc 0%, var(--bg-color) 100%);
}

.app-header {
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(118deg, #312559 0%, #493873 55%, #6b55a0 100%);
  box-shadow: 0 8px 24px rgba(63, 47, 116, 0.18);
}

.app-header .header-logo h1,
.app-header .header-desc,
.app-header .user-email-display,
.app-header .user-icon { color: #fff; }
.app-header .header-desc { color: rgba(255, 255, 255, 0.76); }
.app-header .site-logo { filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.18)); }
.app-header .badge {
  color: #f1ebff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}
.app-header .user-status-bar {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}
.app-header .btn-logout {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.panel,
.history-section {
  border-color: rgba(90, 71, 143, 0.22);
  box-shadow: 0 8px 22px rgba(63, 47, 116, 0.07);
}
.panel-section h2 { color: #3f2f74; }
.step-num { background: linear-gradient(135deg, #3f2f74, #5a478f 70%, #9b89c8); }

.btn-primary {
  background: linear-gradient(135deg, #3f2f74 0%, #5a478f 58%, #866fb8 100%);
  box-shadow: 0 6px 16px rgba(90, 71, 143, 0.24);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #33265f 0%, #4b396f 58%, #725aa5 100%);
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(90, 71, 143, 0.3);
}

.upload-zone,
.logo-upload-zone {
  background: linear-gradient(180deg, #fff 0%, #f7f5fa 100%);
  border-color: #b7abc9;
}
.upload-zone:hover,
.logo-upload-zone:hover { background: #f0edf6; border-color: var(--primary-color); }

input:focus,
textarea:focus,
select:focus,
.font-search-input:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(90, 71, 143, 0.14) !important;
  outline: none;
}
input[type="range"] { accent-color: var(--primary-color); }

.progress-bar-container { background: #e4dfec; }
.progress-bar-fill { background: linear-gradient(90deg, #3f2f74, #5a478f, #9b89c8); }
.preview-canvas-wrapper { border-color: rgba(155, 137, 200, 0.55); box-shadow: 0 14px 30px rgba(63, 47, 116, 0.2); }

.auth-container {
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 12%, rgba(155, 137, 200, 0.3), transparent 32%),
    linear-gradient(145deg, #fcfbfd 0%, #eeeaf4 100%);
}
.auth-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(90, 71, 143, 0.26);
  box-shadow: 0 18px 50px rgba(63, 47, 116, 0.14);
}
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #3f2f74, #5a478f, #9b89c8);
}
.auth-header h2 { color: #3f2f74; letter-spacing: 0.02em; }
.auth-header .site-logo { filter: drop-shadow(0 8px 16px rgba(90, 71, 143, 0.2)); }

.history-table th { background: #ede9f3; color: #51485d; }
.history-table tbody tr:hover { background: #f7f5fa; }
.btn-table-download { background: #ebe6f2; }
.brand-logo-panel { background: linear-gradient(180deg, #faf9fc, #f1eef6); border-color: #d2c8df; }


/* 公開資料ダウンロード */
.auth-container { flex-direction: column; gap: 16px; padding: 28px 16px; }
.public-downloads {
  width: 100%; max-width: 420px; padding: 16px;
  border: 1px solid rgba(90,71,143,.26); border-radius: 14px;
  background: rgba(255,255,255,.9); box-shadow: 0 10px 28px rgba(63,47,116,.08);
}
.public-downloads-heading { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.public-downloads-icon {
  width:34px; height:34px; display:grid; place-items:center; border-radius:50%;
  background:linear-gradient(135deg,#3f2f74,#5a478f); color:#fff; font-size:17px; font-weight:800;
}
.public-downloads-heading strong { color:#3f2f74; font-size:13px; }
.public-downloads-heading p { margin-top:2px; color:var(--text-muted); font-size:10px; }
.public-downloads-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.download-resource {
  display:flex; align-items:center; gap:9px; min-width:0; padding:10px;
  border:1px solid var(--panel-border); border-radius:10px; background:#faf9fc;
  color:var(--text-main); text-decoration:none;
  transition:transform .18s,box-shadow .18s,border-color .18s;
}
.download-resource:hover { transform:translateY(-1px); border-color:var(--primary-color); box-shadow:0 6px 14px rgba(90,71,143,.14); }
.download-resource>span {
  min-width:36px; padding:7px 4px; border-radius:8px; background:#ebe6f2;
  color:var(--primary-color); font-size:10px; font-weight:800; text-align:center;
}
.download-resource strong,.download-resource small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.download-resource strong { font-size:10px; color:#3f2f74; }
.download-resource small { margin-top:2px; font-size:8px; color:var(--text-muted); }
.download-resource-primary { border-color:rgba(90,71,143,.34); background:#f3f0f7; }
.header-guide-link {
  padding:6px 10px; border:1px solid rgba(255,255,255,.3); border-radius:7px;
  background:rgba(255,255,255,.12); color:#fff; font-size:11px; font-weight:700; text-decoration:none;
}
.header-guide-link:hover { background:rgba(255,255,255,.22); }
@media(max-width:480px){.public-downloads-actions{grid-template-columns:1fr}.auth-container{padding:16px 8px}}

/* JOYORO header logo contrast */
.app-header .site-logo { width: 40px; height: 40px; padding: 4px; border-radius: 10px; background: #fff; box-shadow: 0 3px 10px rgba(31, 23, 54, 0.2); filter: none; }
