/* ==========================================================================
   KUWAGATA PREMIUM CARD STUDIO - STYLESHEET (v2.0.0 Mobile First Edition)
   Luxury Obsidian & Gold Theme with Responsive Touch Architecture
   ========================================================================== */

:root {
  --bg-main: #0a0b0e;
  --bg-panel: #13161c;
  --bg-card: #1b1e26;
  --bg-input: #0e1015;
  --border-subtle: rgba(212, 175, 55, 0.2);
  --border-gold: rgba(212, 175, 55, 0.6);
  --gold-gradient: linear-gradient(135deg, #f7e29c 0%, #caa049 50%, #845b18 100%);
  --gold-text: #e6ca65;
  --gold-glow: rgba(212, 175, 55, 0.35);
  --gemini-gradient: linear-gradient(135deg, #4285f4 0%, #9b72cb 50%, #d96570 100%);
  --gemini-btn: linear-gradient(135deg, #1a73e8 0%, #8e24aa 100%);
  --accent-red: #8b181b;
  --text-main: #f0f2f5;
  --text-muted: #9ba3b0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(212, 175, 55, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(66, 133, 244, 0.05) 0%, transparent 40%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* アプリ全体コンテナ (モバイルファースト: スマホで最も美しく操作可能) */
.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 14px;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ヘッダー */
.app-header {
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.header-main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

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

.gold-badge {
  background: var(--gemini-gradient);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.app-header h1 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  letter-spacing: 1px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-version-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-text);
  border: 1px solid var(--border-gold);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.app-header .subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.header-actions {
  display: flex;
  gap: 6px;
}

.btn-icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--gold-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.log-count-pill {
  background: rgba(66, 133, 244, 0.35);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
}

/* メインエリア */
.app-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* ==========================================================================
   プレビューセクション (上部固定表示)
   ========================================================================== */
.preview-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-main);
}

.preview-card-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.85), 0 0 15px rgba(212, 175, 55, 0.15);
  background: #000;
}

#cardCanvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: var(--gold-text);
  font-size: 13px;
  font-weight: 600;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--gold-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 320px;
  margin-top: 10px;
  gap: 6px;
}

.ratio-badge, .res-badge {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--gold-text);
}

.btn-refresh {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
}

/* ==========================================================================
   タブナビゲーション (5大機能・横スクロール対応)
   ========================================================================== */
.tab-navigation {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-navigation::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn.active {
  background: linear-gradient(180deg, #2a313e 0%, #1e232d 100%);
  color: var(--gold-text);
  border-color: var(--border-gold);
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.2);
}

/* コントロールセクション */
.control-section {
  display: flex;
  flex-direction: column;
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 14px;
}

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

.section-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-main);
}

.section-card.gemini-card {
  border-color: rgba(155, 114, 203, 0.4);
  background: linear-gradient(180deg, rgba(66, 133, 244, 0.05) 0%, rgba(19, 22, 28, 0.95) 100%);
}

.section-card.highlight-card {
  border-color: var(--border-gold);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.05) 0%, rgba(19, 22, 28, 0.95) 100%);
}

.card-header-with-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.card-title {
  font-size: 14px;
  color: var(--gold-text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-header-with-badge .card-title {
  margin-bottom: 0;
}

.ai-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  background: var(--gemini-gradient);
  color: #fff;
}

.section-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

/* ==========================================================================
   単語トグル式 プロンプト・パーツビルダー (②)
   ========================================================================== */
.chip-group {
  margin-bottom: 12px;
}

.chip-group-label {
  font-size: 11px;
  color: var(--gold-text);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.word-chip {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 18px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.word-chip:hover {
  border-color: rgba(212, 175, 55, 0.5);
  color: #fff;
}

.word-chip.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--border-gold);
  color: var(--gold-text);
  font-weight: 700;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

.combined-prompt-area {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.form-sublabel {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.prompt-action-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-copy-main {
  flex: 1;
  background: var(--gold-gradient);
  color: #111;
  font-size: 12px;
  font-weight: 700;
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--gold-glow);
}

.btn-gemini-jump {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  background: rgba(66, 133, 244, 0.15);
  border: 1px solid rgba(66, 133, 244, 0.4);
  color: #90caf9;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.direct-generate-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-generate-ai {
  width: 100%;
  padding: 11px 16px;
  background: var(--gemini-btn);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Vision AI & フォーム要素
   ========================================================================== */
.vision-upload-box, .bg-upload-box {
  border: 2px dashed rgba(155, 114, 203, 0.4);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  text-align: center;
  background: rgba(155, 114, 203, 0.05);
  cursor: pointer;
}

.bg-upload-box {
  border-color: var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.file-input-hidden { display: none; }
.upload-icon { font-size: 22px; margin-bottom: 4px; display: block; }
.upload-prompt p { font-size: 12px; }
.upload-prompt .upload-sub { font-size: 10px; color: var(--text-muted); }

.vision-result-card {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(155, 114, 203, 0.5);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.vision-header h4 { font-size: 12px; color: #ce93d8; }

.extracted-prompt-box {
  background: #090a0e;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.prompt-text-ja { font-weight: 500; margin-bottom: 4px; }
.prompt-text-en { font-size: 10px; color: var(--text-muted); }

.extracted-actions {
  display: flex;
  gap: 6px;
}

.btn-sm { padding: 5px 10px !important; font-size: 11px !important; }
.btn-copy-sm {
  background: rgba(66, 133, 244, 0.2);
  border: 1px solid rgba(66, 133, 244, 0.5);
  color: #90caf9;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* フォーム */
.form-group {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label { font-size: 12px; color: var(--text-muted); }

input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold-text);
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.input-combo { display: flex; gap: 6px; }
.input-short { width: 70px !important; flex-shrink: 0; text-align: center; }

.slider-group { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.slider-header { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.slider-header span { color: var(--gold-text); }
input[type="range"] { width: 100%; accent-color: var(--gold-text); height: 5px; }

/* アスペクト比 */
.ratio-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.ratio-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
}

.ratio-btn .ratio-name { font-size: 10px; white-space: nowrap; }
.ratio-btn .ratio-val { font-size: 12px; font-weight: 700; margin-top: 2px; }
.ratio-btn.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--border-gold);
  color: var(--gold-text);
}

.preset-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.preset-btn {
  padding: 6px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
}

.preset-btn.active {
  border-color: var(--border-gold);
  color: var(--gold-text);
  background: rgba(212, 175, 55, 0.15);
}

/* ==========================================================================
   エクスポート ＆ アーカイブギャラリー (⑥⑦)
   ========================================================================== */
.export-actions { display: flex; flex-direction: column; gap: 10px; }
.export-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  gap: 10px;
}

.export-info h4 { font-size: 12px; margin-bottom: 2px; }
.export-info p { font-size: 10px; color: var(--text-muted); }

.btn-primary, .btn-secondary {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #111;
  border: none;
  font-weight: 700;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--gold-text);
}

.btn-archive-save {
  width: 100%;
  padding: 10px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px dashed var(--border-gold);
  color: var(--gold-text);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-archive-save:hover {
  background: rgba(212, 175, 55, 0.25);
}

.btn-group-row { display: flex; gap: 8px; margin-top: 6px; }
.btn-group-row button { flex: 1; }

/* アーカイブ一覧 */
.archive-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
}

.archive-card-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}

.archive-thumb {
  width: 48px;
  height: 68px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: #000;
  flex-shrink: 0;
}

.archive-details {
  flex: 1;
  min-width: 0;
}

.archive-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-text);
  margin-bottom: 2px;
}

.archive-meta {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

.archive-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   モーダル ＆ ログ
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  z-index: 100;
}

.modal-backdrop.hidden { display: none; }

.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 { font-size: 14px; color: var(--gold-text); }
.btn-modal-close { background: transparent; border: none; color: #aaa; font-size: 16px; cursor: pointer; }

.modal-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.modal-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-card);
}

.log-terminal-window {
  background: #090a0d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.5;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry { display: flex; gap: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.03); padding-bottom: 2px; }
.log-time { color: #666; font-size: 10px; flex-shrink: 0; }
.log-tag { font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 3px; }
.log-tag.info { background: #1a365d; color: #90caf9; }
.log-tag.api { background: #3b1b54; color: #ce93d8; }
.log-tag.success { background: #143d24; color: #81c784; }
.log-tag.warn { background: #4a3800; color: #ffe082; }
.log-tag.error { background: #4c1d1d; color: #ef9a9a; }
.log-msg { color: #ddd; flex: 1; }

.ai-status-msg { margin-top: 8px; padding: 8px 10px; border-radius: 4px; font-size: 11px; }
.ai-status-msg.hidden { display: none; }
.ai-status-msg.info { background: rgba(66, 133, 244, 0.15); color: #90caf9; }
.ai-status-msg.success { background: rgba(40, 167, 69, 0.15); color: #a5d6a7; }
.ai-status-msg.error { background: rgba(220, 53, 69, 0.15); color: #ff8a80; }

.app-footer {
  text-align: center;
  padding: 16px 0 8px;
  font-size: 11px;
  color: #555c68;
}

/* ==========================================================================
   v2.1.0 Custom Dictionary & Clean Background Options
   ========================================================================== */
.toggle-option-card {
  background: rgba(155, 114, 203, 0.1);
  border: 1px solid rgba(155, 114, 203, 0.4);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.custom-chip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.custom-chip-count {
  font-size: 10px;
  color: var(--gold-text);
  background: var(--bg-card);
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.add-chip-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.add-chip-form input {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
}

.word-chip.custom {
  position: relative;
  padding-right: 22px;
}

.chip-del-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #ef5350;
  cursor: pointer;
  padding: 2px;
}

.chip-del-btn:hover {
  color: #ff8a80;
}

/* ==========================================================================
   v2.2.0 Prompt Dictionary Manager Styles
   ========================================================================== */
.dict-modal-card {
  max-width: 620px;
  max-height: 85vh;
}

.dict-modal-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dict-add-bar {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.dict-add-bar input {
  flex: 1;
  font-size: 12px;
  padding: 6px 8px;
}

.dict-add-bar select {
  width: 130px;
  font-size: 11px;
  padding: 6px 4px;
}

.dict-item-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.dict-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  transition: all 0.15s;
}

.dict-item-row.hidden-chip {
  opacity: 0.5;
  background: rgba(0, 0, 0, 0.3);
}

.dict-item-cat {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
}

.dict-item-cat.prefix { color: #90caf9; }
.dict-item-cat.texture { color: #ffe082; }
.dict-item-cat.color { color: #a5d6a7; }
.dict-item-cat.decor { color: #ffd54f; }
.dict-item-cat.quality { color: #ce93d8; }
.dict-item-cat.custom { color: #f48fb1; border: 1px solid rgba(244, 143, 177, 0.3); }

.dict-item-input {
  flex: 1;
  font-size: 12px;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--text-main);
  padding: 4px 6px !important;
}

.dict-item-input:focus {
  border-color: var(--border-gold) !important;
  background: #111 !important;
}

.dict-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-toggle-vis {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-toggle-vis.off {
  color: #777;
  border-color: rgba(255, 255, 255, 0.05);
}

.btn-chip-del {
  color: #ef5350;
  background: transparent;
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 5px;
}

.dict-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   v2.2.1 Inline Dropzone Loading Styles
   ========================================================================== */
.vision-loading-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
}

.vision-loading-inline.hidden {
  display: none;
}

.spinner-purple {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(155, 114, 203, 0.25);
  border-top-color: #ce93d8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.vision-loading-title {
  font-size: 13px;
  font-weight: 700;
  color: #ce93d8;
  letter-spacing: 0.5px;
}

.vision-loading-sub {
  font-size: 10px;
  color: var(--text-muted);
}

/* ==========================================================================
   v2.3.0 Dynamic Category Architecture Styles
   ========================================================================== */
.category-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.sub-section-title {
  font-size: 12px;
  color: var(--gold-text);
  margin-bottom: 4px;
  font-weight: 700;
}

.category-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.category-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
}

.category-input-row label {
  font-size: 10px;
  color: var(--text-muted);
  width: 55px;
  flex-shrink: 0;
}

.category-input-row input {
  flex: 1;
  font-size: 11px;
  background: transparent !important;
  border: none !important;
  color: var(--gold-text);
  padding: 3px 4px !important;
  font-weight: 600;
}

.dict-item-cat-select {
  width: 110px;
  font-size: 11px;
  padding: 3px 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--gold-text);
  border-radius: 4px;
  flex-shrink: 0;
}

.dict-item-cat-select:focus {
  border-color: var(--border-gold);
}

/* ==========================================================================
   v2.4.0 Dual-Key Switcher Styles
   ========================================================================== */
.btn-key-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-key-toggle.free {
  background: rgba(46, 125, 50, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.5);
  color: #a5d6a7;
}

.btn-key-toggle.paid {
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.6);
  color: var(--gold-text);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.key-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4caf50;
}

.btn-key-toggle.paid .key-status-dot {
  background: #ffd54f;
  box-shadow: 0 0 6px #ffd54f;
}

/* ==========================================================================
   v2.5.0 Authentication Gate Styles
   ========================================================================== */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #1a1610 0%, #080706 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(10px);
}

.auth-gate-overlay.authenticated {
  display: none !important;
}

.auth-gate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 30px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.2);
  text-align: center;
}

.auth-logo-area h2 {
  font-family: 'Cinzel', serif;
  color: var(--gold-text);
  font-size: 20px;
  letter-spacing: 2px;
  margin: 8px 0 4px;
}

.auth-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.auth-form label {
  font-size: 11px;
  color: var(--text-main);
  font-weight: 600;
}

.auth-form input {
  font-size: 14px;
  letter-spacing: 2px;
  text-align: center;
  padding: 10px;
  background: #0d0e11 !important;
  border-color: var(--border-gold) !important;
}

.auth-error-msg {
  color: #ef5350;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.btn-auth-submit {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.auth-footer-note {
  font-size: 10px;
  color: #666;
  margin-top: 16px;
}

/* ==========================================================================
   v2.6.0 Data Backup & Cloud Migration Styles
   ========================================================================== */
.backup-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backup-box-info h4 {
  font-size: 13px;
  color: var(--gold-text);
  margin-bottom: 2px;
  font-weight: 700;
}

.backup-box-info p {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   v2.7.0 Cloud Sync Header & Status Styles
   ========================================================================== */
.btn-sync-status {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(30, 26, 20, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sync-status:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: #ffd54f;
}

.sync-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #757575;
}

.sync-status-dot.online {
  background: #66bb6a;
  box-shadow: 0 0 6px #66bb6a;
}

.sync-status-dot.syncing {
  background: #ffd54f;
  box-shadow: 0 0 6px #ffd54f;
  animation: pulse-sync 1s infinite alternate;
}

.sync-badge-live {
  font-size: 11px;
  color: #81c784;
  font-weight: 700;
  padding: 2px 8px;
  background: rgba(76, 175, 80, 0.15);
  border-radius: 4px;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

@keyframes pulse-sync {
  from { opacity: 0.4; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}
