/* ── リセット・変数（白ベースのライトテーマ） ───────────────────── */
:root {
  --bg:         #ffffff;
  --surface:    #f7f7fb;
  --surface2:   #edeef7;
  --border:     #e2e3ef;
  --text:       #1c1c26;
  --text-sub:   #5c5c6f;
  --text-muted: #6b6b80;
  --accent:     #4338CA; /* インディゴ。キャラクター系Prompt Builder(ピンク)とは別の配色で区別する */
  --accent-bg:  #4338CA12;
  --radius:     8px;
  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  max-width: 1440px;
  margin: 0 auto;
  padding-bottom: 40px;
}
button { font-family: var(--font); cursor: pointer; }
textarea, select { font-family: var(--font); }
.hidden { display: none !important; }

/* ── ヘッダー ───────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.title-main { font-size: 16px; font-weight: 600; }
.title-sub  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.model-select-wrap { display: flex; align-items: center; gap: 6px; }
.model-select-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.model-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
}

/* ── メインレイアウト（2カラム） ───────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 1fr);
  align-items: start;
  gap: 20px;
  padding: 20px;
}
.col-left { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 12px;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .col-right { position: static; }
}

/* ── パネル共通 ─────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.panel-label { font-size: 12px; font-weight: 600; color: var(--text-sub); margin-bottom: 8px; }

.idea-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  resize: vertical;
}
.idea-textarea:focus { outline: none; border-color: var(--accent); }

/* ── カテゴリタブ ───────────────────────────────────────────────── */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cat-tabs-loading { font-size: 12px; color: var(--text-muted); }
.cat-tab {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-sub);
}
.cat-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
  font-weight: 600;
}
.cat-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  padding: 1px 6px;
  margin-left: 2px;
}

.cat-content { min-height: 40px; }
.chip-subhead {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 10px 0 4px;
}
.chip-subhead:first-child { margin-top: 0; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--text);
}
.chip:hover { border-color: var(--accent); }
.chip.chip-on {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
  font-weight: 600;
}

/* ── ボタン ─────────────────────────────────────────────────────── */
.btn {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  flex: 1;
  font-weight: 600;
}
.btn-primary:hover { opacity: .92; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-accent { border-color: var(--accent); color: var(--accent); }
.btn.copied { background: var(--accent); color: #fff; border-color: var(--accent); }
.action-row { display: flex; gap: 8px; }

/* ── 出力パネル ─────────────────────────────────────────────────── */
.output-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lang-toggle { display: flex; gap: 4px; }
.lang-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
}
.lang-btn.lang-on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.output-actions { display: flex; gap: 6px; }
.output-wrap { position: relative; }
.output-box {
  width: 100%;
  min-height: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13px;
  color: var(--text);
  resize: vertical;
}
.output-empty {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── トースト通知 ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 100;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12.5px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.toast-error { background: #B91C1C; }
.toast-close { background: none; border: none; color: inherit; opacity: .7; font-size: 12px; }
.toast-close:hover { opacity: 1; }
