/* AIプロンプト（個人ライブラリ）。
   本文は pre で改行をそのまま見せ、一覧では行数を抑えて読みやすくする。 */
.ai-prompt-toolbar{display:flex;gap:10px;margin:0 0 14px;flex-wrap:wrap}
.ai-prompt-toolbar input[type=search]{flex:1 1 260px;min-width:0}
/* select は既定で width:100% なので、そのままだと絞り込み1つが1行を占める。
   横幅を分け合わせ、狭くなったら箱ごと折り返させる。 */
.ai-prompt-toolbar select{flex:0 1 170px;width:auto;min-width:0}
.ai-prompt-list{display:grid;gap:12px}
.ai-prompt-card{padding:16px 18px;border:1px solid var(--line);border-radius:10px;background:#fff}
.ai-prompt-card.is-pinned{border-color:#c8a86b;background:#fffdf7}
.ai-prompt-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.ai-prompt-head h4{margin:0;font-size:15px;line-height:1.5;word-break:break-word}
.ai-prompt-badges{display:flex;gap:6px;flex-wrap:wrap}
.ai-prompt-badge{padding:2px 9px;border-radius:999px;background:var(--paper);
  border:1px solid var(--line);color:var(--muted);font-size:11px;white-space:nowrap}
.ai-prompt-badge.is-pin{background:#f0dfba;border-color:#c8a86b;color:#6b5320}
.ai-prompt-tag{padding:2px 9px;border-radius:999px;background:#eef3ef;color:#3d5147;font-size:11px}
/* 長文は行数で切る。pre なので改行・字下げ・記号はそのまま。 */
.ai-prompt-body{margin:10px 0 0;padding:12px 14px;border-radius:8px;background:var(--paper);
  border:1px solid var(--line);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:12.5px;line-height:1.7;white-space:pre-wrap;word-break:break-word;
  max-height:9.5em;overflow:hidden}
.ai-prompt-meta{margin:8px 0 0;color:var(--muted);font-size:12px}
.ai-prompt-actions{display:flex;align-items:center;gap:8px;margin-top:12px;flex-wrap:wrap}
.ai-prompt-actions button{padding:6px 14px;min-height:44px;border:1px solid var(--line);border-radius:6px;
  background:#fff;cursor:pointer;font-size:13px}
.ai-prompt-actions button.primary{border-color:var(--green);background:var(--green);color:#fff;font-weight:700}
.ai-prompt-actions button.danger{border-color:#e0b4ae;color:#8c2f26}
.ai-prompt-actions button:disabled{opacity:.6;cursor:default}
.ai-prompt-actions button:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.ai-prompt-status{color:var(--green);font-size:12px;line-height:1.6}
.ai-prompt-status.is-error{color:#8c2f26}
.ai-prompt-empty{padding:34px 20px;border:1px dashed var(--line);border-radius:10px;
  background:var(--paper);text-align:center}
.ai-prompt-empty strong{display:block;font-size:15px}
.ai-prompt-empty p{margin:8px 0 0;color:var(--muted);font-size:13px;line-height:1.8}
.ai-prompt-pin{display:flex;align-items:center;gap:8px}
.ai-prompt-pin input{width:auto}
#aiPromptForm textarea{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:13px;line-height:1.7;white-space:pre-wrap}
/* 全文を開いた行は高さの制限を外す。畳んだままの行と区別が付くようにする。 */
.ai-prompt-card.is-expanded .ai-prompt-body{max-height:none;overflow:visible}
.ai-prompt-more{margin:8px 0 0;padding:6px 12px;min-height:44px;border:1px solid var(--line);border-radius:6px;
  background:#fff;cursor:pointer;font-size:12px;color:var(--green);font-weight:700}
.ai-prompt-more:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.ai-prompt-more:disabled{opacity:.6;cursor:default}
.ai-prompt-count{margin:0 0 10px;color:var(--muted);font-size:12px;line-height:1.7}
.ai-prompt-count:empty{margin:0}
.ai-prompt-badge.is-kind{border-color:var(--green);color:var(--green);font-weight:700}
.ai-prompt-badge.is-category{background:var(--paper)}
.form-hint{display:block;margin-top:4px;color:var(--muted);font-size:11px;line-height:1.6}
@media (max-width:800px){
  .ai-prompt-toolbar{flex-direction:column}
  /* 縦並びでは flex-basis が主軸＝高さに効く。260px の検索欄にしない。 */
  .ai-prompt-toolbar input[type=search],.ai-prompt-toolbar select{flex:0 0 auto;width:100%}
  .ai-prompt-actions button{flex:1 1 auto}
  .ai-prompt-body{font-size:12px;max-height:11em}
  .ai-prompt-card.is-expanded .ai-prompt-body{max-height:none}
  .ai-prompt-more{width:100%}
}
