/* 常時ライトモード固定定義 */
:root, body, main {
    --bg-color: #ffffff !important;
    --text-color: #202124 !important;
    --link-color: #1a73e8 !important;
    --border-color: #dadce0 !important;
    --table-header-bg: #f8f9fa !important;
    --table-hover-bg: #f1f3f4 !important;
}
/* danbooru_json_to_sd.css
   Styles for prompt_builder.html
   Save as: css/tools_css/danbooru_json_to_sd.css
   2026-07-19 最終最適化版 - 縦並び不具合修正&ポジネガ分離版

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: #e2e8f0;
  --accent: #0069c0;
  --accent2: #d44a8f;
  --text: #1e293b;
  --text-sub: #475569;
  --radius: 10px;
  --font-mono: 'JetBrains Mono', 'Fira Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  font-family: "Noto Sans JP", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

h1 { font-size: 1.6rem; margin: 0 0 8px 0; font-weight: 700; }
h2 { font-size: 1.15rem; margin: 12px 0; color: var(--text); }
header .hint { color: var(--text-sub); font-size: 0.9em; margin-bottom: 10px; }

/* 共通テキストエリア
textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: #111;
  resize: vertical;
  transition: border-color 0.2s;
}
textarea:focus { outline: none; border-color: var(--accent); }
textarea[readonly] { background: var(--surface2); color: #4f5b73; cursor: not-allowed; }

/* セクション
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.section-title {
  font-size: 0.95em;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-sub);
  margin-top: 0;
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* ツリーコンテナ
.tree-container {
  min-height: 160px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 12px;
  font-size: 0.9rem;
}
.tree-item { margin: 5px 0; }

/* ★ 子要素コンテナ：縦並びフレックス化で、横に潰れてしまうバグを修正
.tree-children {
  margin-left: 18px;
  border-left: 1px dashed var(--border);
  padding-left: 12px;
display: flex;
/* flex-direction: column;
  gap: 2px;
}

/* ★ 各タグのラベル：1行単位のクリック領域を適正化
.tree-children label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88em;
  font-family: var(--font-mono);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  transition: background 0.15s;
  width: fit-content;
}
.tree-children label:hover { background: #e8e4ff; }
.tree-children input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; }

.tree-item details > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  padding: 2px 4px;
}
.tree-item details > summary::-webkit-details-marker { display: none; }
.tree-item details > summary::before { content: "▶ "; font-size: 0.7em; display: inline-block; width: 14px; }
.tree-item details[open] > summary::before { content: "▼ "; }

/* チップ（ネガティブ推奨用）
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  margin: 4px;
  font-family: var(--font-mono);
  transition: transform 0.12s, opacity 0.12s, background-color 0.12s;
  user-select: none;
}
.chip:hover { transform: translateY(-1px); opacity: 0.9; }
.chip:active { transform: translateY(0); }
.chip-neg { background: #ffe8e8; color: #a33; border: 1px solid #f5b5b5; }
.chip-neg:hover { background: #ffd4d4; }

/* 情報パネル・配置エリア
.info-panel { font-size: 0.9rem; color: var(--text-sub); margin-bottom: 10px; }
.chara-grid { display: flex; flex-wrap: wrap; padding: 4px 0; }
#shared-links-container {
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 20px;
  padding-bottom: 10px;
  min-height: 24px;
}

/* ボタン
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.btn, .action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.92em;
  font-weight: 600;
  transition: all 0.15s;
  user-select: none;
}
.btn:hover, .action-btn:hover { background: var(--surface2); transform: translateY(-1px); }
.btn-primary, .action-btn.primary {
  background: linear-gradient(180deg, var(--accent), #4a3fb8);
  color: #fff;
  border-color: #4a3fb8;
}
.btn-primary:hover { filter: brightness(1.05); }

.hint { color: var(--text-sub); font-size: 0.85rem; }
.hidden, .is-hidden { display: none !important; }
.error-msg { color: #e23c3c; font-size: 0.85em; margin-top: 8px; min-height: 1.2em; font-weight: 600; }
.text-muted { color: var(--text-sub); font-size: 0.9rem; }
.small { font-size: 0.85rem; }

@media (max-width: 640px) {
  body { padding: 14px; }
  .btn, .action-btn { flex: 1 1 auto; padding: 10px 12px; justify-content: center; }
  .btn-row { width: 100%; }
}

/* fix v1.7.3b: neg common
@media(max-width:767px){.neg-grid{grid-template-columns:1fr !important;}}

/* --- 2026-09-10 inline styles --- */
.is-hidden {
            display: none !important;

.break-switcher .break-link {
                    padding: 6px 12px;
                    border-radius: 999px;
                    background: #eef2ff;
                    color: #ddd;
                    text-decoration: none;
                    font-weight: 600;
                    font-size: 0.85em;
                .break-switcher .break-link:hover {
                    background: #dbe4ff;
                    color: #fff;
                .break-switcher .break-link.active {
                    background: #0066cc;
                    color: #fff;
                    pointer-events: none;

/* =========================================================
   2026-09-19 ページ別薄色背景（#eff6ff）
   ========================================================= */
#shared-links-container{border-bottom:2px solid #eee;margin-bottom:20px;padding-bottom:10px}
/* === neg-section (shared component) === */
#neg-section-inner .neg-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: start !important;
  margin-top: 12px;
}
@media (max-width: 768px) {
  #neg-section-inner .neg-grid {
    grid-template-columns: 1fr !important;
  }
}
#neg-section-inner .neg-block {
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  min-width: 0;
}
#neg-section-inner .neg-block label {
  font-weight: 700;
  font-size: 0.9em;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#neg-section-inner .neg-block textarea {
  width: 100%;
  min-height: 160px;
  font-family: monospace;
  font-size: 0.85em;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  resize: vertical;
}
#neg-section-inner .neg-block button {
  white-space: nowrap;
}
