/* Otoolia — Rédacteur de prompts (styles limités à .pr / .pr-*) */
.pr-head h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: .2em; }
.pr h2 { font-size: 1.08rem; margin: 0 0 10px; }
.pr h3 { font-size: .95rem; margin: 0; }
.pr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Onglets */
.pr-tabs { display: flex; gap: 6px; margin: 18px 0 16px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.pr-tab { flex: none; border: 1px solid var(--ot-border); background: var(--ot-surface); color: var(--ot-text); font: inherit; font-weight: 600; font-size: .93rem; padding: 9px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.pr-tab:hover { border-color: var(--ot-logo-blue); }
.pr-tab[aria-selected="true"] { background: var(--ot-brand); border-color: var(--ot-brand); color: #fff; }
.pr-badge { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 999px; background: var(--ot-logo-orange); color: #1b1b29; font-size: .75rem; text-align: center; margin-left: 2px; }

/* Bibliothèque */
.pr-search { display: flex; align-items: center; gap: 10px; }
.pr-search .ot-input { flex: 1; font-size: 1.02rem; padding: 12px 14px; }
.pr-count { color: var(--ot-text-soft); font-size: .85rem; white-space: nowrap; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.pr-chip { border: 1px solid var(--ot-border); background: var(--ot-surface); color: var(--ot-text); font: inherit; font-size: .84rem; padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.pr-chip small { color: var(--ot-text-soft); font-size: .74rem; }
.pr-chip:hover { border-color: var(--ot-logo-blue); }
.pr-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--ot-brand) 14%, var(--ot-surface)); border-color: var(--ot-brand); font-weight: 600; }
.pr-chip--sm { font-size: .8rem; padding: 3px 9px; }
.pr-libgrid { display: grid; gap: var(--ot-space); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .pr-libgrid { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); } .pr-list { max-height: calc(100vh - 140px); overflow-y: auto; position: sticky; top: 12px; padding-right: 4px; } .pr-detail { position: sticky; top: 12px; } .pr-back { display: none; } }
.pr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pr-card { display: flex; align-items: stretch; border: 1px solid var(--ot-border); border-radius: var(--ot-radius-s); background: var(--ot-surface); transition: border-color .15s, box-shadow .15s; }
.pr-card:hover { border-color: var(--ot-logo-blue); }
.pr-card.is-sel { border-color: var(--ot-brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ot-brand) 25%, transparent); }
.pr-card-b { flex: 1; display: flex; gap: 10px; align-items: flex-start; text-align: left; background: none; border: 0; padding: 10px 4px 10px 12px; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.pr-card-b b { display: block; font-size: .95rem; }
.pr-card-b small { display: block; color: var(--ot-text-soft); font-size: .82rem; line-height: 1.35; margin-top: 2px; }
.pr-ic { font-size: 1.3rem; line-height: 1.2; }
.pr-star { background: none; border: 0; font-size: 1.15rem; color: var(--ot-logo-orange); padding: 0 12px; cursor: pointer; }
.pr-empty { color: var(--ot-text-soft); padding: 12px; border: 1px dashed var(--ot-border); border-radius: var(--ot-radius-s); list-style: none; }
.pr-detail { min-height: 260px; }
.pr-hello { text-align: center; padding: 40px 10px; color: var(--ot-text-soft); }
.pr-big { font-size: 1.25rem; font-weight: 700; color: var(--ot-text); }
.pr-cat { font-size: .8rem; color: var(--ot-text-soft); margin: 4px 0 2px; text-transform: uppercase; letter-spacing: .04em; }
.pr-detail h2 { font-size: 1.35rem; margin: 0 0 4px; }
.pr-fields { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 14px 0 6px; }
.pr-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pr-field--long { grid-column: 1 / -1; }
.pr-field label, .pr-lab { font-size: .82rem; font-weight: 600; color: var(--ot-text-soft); display: block; margin: 10px 0 4px; }
.pr-field label { margin: 0; }
.pr-field .ot-input, .pr-field .ot-select, .pr-form .ot-input, .pr-form .ot-select { width: 100%; }
.pr-field textarea, .pr-form textarea { resize: vertical; }
.pr-other { margin-top: 4px; }
.pr-prevhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 16px 0 8px; }
.pr-prevhead h2, .pr-prevhead h3 { margin: 0; margin-right: auto; }
.pr-side .pr-prevhead { margin-top: 0; }
.pr-miss { font-size: .82rem; font-weight: 600; }
.pr-miss.is-warn { color: #b26a00; } .pr-miss.is-ok { color: var(--ot-success); }
.pr-out { white-space: pre-wrap; word-break: break-word; font-family: var(--ot-mono); font-size: .86rem; line-height: 1.55; background: var(--ot-surface-2); border: 1px solid var(--ot-border); border-radius: var(--ot-radius-s); padding: 14px 16px; margin: 0; max-height: 60vh; overflow: auto; }
.pr-out.is-empty { color: var(--ot-text-soft); font-family: inherit; }
.pr-free { width: 100%; min-height: 280px; }
.pr-v { background: color-mix(in srgb, var(--ot-logo-blue) 18%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; cursor: pointer; }
.pr-ph { background: color-mix(in srgb, var(--ot-logo-orange) 28%, transparent); border-radius: 3px; padding: 0 2px; font-weight: 600; cursor: pointer; }
.pr-meta { font-size: .78rem; color: var(--ot-text-soft); margin: 6px 0 0; }
.pr-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.pr-copy { font-size: 1rem; padding: 10px 18px; }
.pr-open { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; color: var(--ot-text-soft); }
.pr-sm { min-height: 32px; padding: 4px 11px; font-size: .84rem; }
.pr-help { font-size: .82rem; color: var(--ot-text-soft); margin: 8px 0 0; }
.pr-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

/* Créateur */
.pr-buildgrid { display: grid; gap: var(--ot-space); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .pr-buildgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pr-side { position: sticky; top: 12px; } }
.pr-form, .pr-side { display: grid; gap: var(--ot-space); min-width: 0; }
.pr-form > .ot-panel > :first-child, .pr-side > .ot-panel > :first-child { margin-top: 0; }
.pr-req { color: var(--ot-danger); }
.pr-starters { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 6px; font-size: .8rem; color: var(--ot-text-soft); }
.pr-starters > span:last-child { display: contents; }
.pr-grid2 { display: grid; gap: 4px 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pr-x { margin-top: 4px; }
.pr-checks { display: grid; gap: 6px; }
.pr-ck { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; line-height: 1.35; cursor: pointer; }
.pr-ck input { margin-top: 3px; }
.pr-pres { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ot-text-soft); }
.pr-pres .ot-select { width: auto; min-height: 32px; padding: 2px 8px; font-size: .84rem; max-width: 230px; }

/* Score */
.pr-meter { margin-bottom: 10px; }
.pr-meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; margin-bottom: 6px; }
.pr-bar { height: 10px; border-radius: 999px; background: var(--ot-surface-2); overflow: hidden; border: 1px solid var(--ot-border); }
.pr-bar i { display: block; height: 100%; border-radius: 999px; transition: width .3s; }
.pr-meter.is-ok .pr-bar i { background: var(--ot-success); } .pr-meter.is-mid .pr-bar i { background: var(--ot-logo-blue); }
.pr-meter.is-warn .pr-bar i { background: var(--ot-logo-orange); } .pr-meter.is-bad .pr-bar i { background: var(--ot-danger); }
.pr-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.pr-checklist li { display: flex; gap: 8px; font-size: .87rem; line-height: 1.35; }
.pr-checklist li > span { width: 1.2em; flex: none; text-align: center; font-weight: 700; }
.pr-checklist small { display: block; color: var(--ot-text-soft); font-size: .8rem; }
.pr-checklist .is-ok > span { color: var(--ot-success); } .pr-checklist .is-no > span { color: var(--ot-text-soft); }
.pr-checklist .is-no b { font-weight: 600; } .pr-checklist .is-warn > span { color: #b26a00; }

/* Analyseur et mes prompts */
.pr-cin { width: 100%; font-family: var(--ot-mono); font-size: .86rem; }
.pr-file { position: relative; overflow: hidden; } .pr-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pr-mlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.pr-saved { border: 1px solid var(--ot-border); border-radius: var(--ot-radius-s); padding: 12px 14px; }
.pr-saved-h { display: flex; justify-content: space-between; gap: 8px; }
.pr-saved-h small { color: var(--ot-text-soft); }
.pr-saved-t { white-space: pre-wrap; font-size: .84rem; color: var(--ot-text-soft); margin: 6px 0 0; font-family: var(--ot-mono); }
.pr-del { color: var(--ot-danger); }
.pr-about { margin-top: calc(var(--ot-space) * 2); }
.pr-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ot-text); color: var(--ot-bg); padding: 10px 18px; border-radius: 999px; font-size: .9rem; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
@media print { .pr-tabs, .pr-search, .pr-chips, .pr-list, .pr-acts, .pr-about { display: none !important; } }
@media (max-width: 999px) {
  #pr-lib:not(.is-open) .pr-detail { display: none; }
  #pr-lib.is-open .pr-search, #pr-lib.is-open .pr-chips, #pr-lib.is-open .pr-list, #pr-lib.is-open > .pr-help { display: none; }
}
@media (min-width: 1000px) { .pr-list, .pr-detail, .pr-side { top: 76px; } .pr-list { max-height: calc(100vh - 96px); } }
@media (max-width: 699px) {
  .pr-search { flex-wrap: wrap; gap: 4px; } .pr-search .ot-input { flex-basis: 100%; } .pr-count { font-size: .78rem; }
  .pr-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; margin-right: -16px; padding-right: 16px; } .pr-chip { flex: none; }
}
