/* Aide IA : reprend les couleurs et les cartes du studio existant. */
.ai-help-dialog { --ai-help-top:0px; --ai-help-height:100dvh; width:min(760px,calc(100vw - 32px)); height:calc(var(--ai-help-height) - 32px); max-height:none !important; max-width:100% !important; padding:0; border:1px solid var(--line); border-radius:22px; color:var(--text); background:var(--panel); box-shadow:0 28px 70px #0008; overflow:hidden; }
.ai-help-dialog[open] { display:flex; flex-direction:column; position:fixed !important; inset:auto 0 !important; top:calc(var(--ai-help-top) + 16px) !important; margin:0 auto !important; transform:none !important; overflow:hidden; }
.ai-help-dialog::backdrop { background:#000a; backdrop-filter:blur(4px); }
.ai-help-header { display:flex; flex-shrink:0; align-items:center; gap:12px; padding:18px 20px; border-bottom:1px solid var(--line-soft); }
.ai-help-mark { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; border:1px solid #ff7a1a40; border-radius:14px; background:#ff7a1a12; color:var(--orange); }
.ai-help-icon { width:18px; height:18px; flex:0 0 18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.ai-help-mark .ai-help-icon,.ai-help-icon-button .ai-help-icon,.ai-help-send .ai-help-icon { width:22px; height:22px; }
.ai-help-action,.ai-help-chip,.ai-help-text-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.ai-help-chip { justify-content:flex-start; }
.ai-help-button-label { min-width:0; overflow-wrap:anywhere; }
.ai-help-header > div { flex:1; min-width:0; }
.ai-help-header h2 { margin:0; font-size:20px; line-height:1.4; }
.ai-help-header p { margin:3px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.ai-help-icon-button { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--surface); color:var(--text); font-size:28px; line-height:1; }
.ai-help-toolbar { display:flex; flex-shrink:0; flex-wrap:wrap; align-items:center; gap:8px 14px; padding:10px 20px; border-bottom:1px solid var(--line-soft); }
.ai-help-toolbar p { flex:1 1 180px; margin:0; color:var(--muted); font-size:11px; line-height:1.5; }
.ai-help-text-button { min-height:36px; padding:6px 0; border:0; color:var(--muted); background:none; font-size:11px; font-weight:700; }
.ai-help-thread { display:flex; flex:1 1 0; min-height:0; flex-direction:column; gap:20px; padding:24px 20px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scroll-padding-block:20px; scrollbar-width:thin; scrollbar-color:var(--line) transparent; overflow-anchor:none; }
.ai-help-entry { display:flex; flex-direction:column; align-items:flex-start; flex-shrink:0; gap:10px; min-width:0; max-width:94%; }
.ai-help-entry[data-role="user"] { align-self:flex-end; align-items:flex-end; max-width:88%; }
.ai-help-author { color:var(--muted); font-size:10px; font-weight:700; }
.ai-help-bubble { max-width:100%; padding:14px 16px; border:1px solid var(--line); border-radius:4px 18px 18px; background:var(--surface); color:var(--text); font-size:14px; line-height:1.75; white-space:pre-wrap; overflow-wrap:anywhere; }
.ai-help-entry[data-role="user"] .ai-help-bubble { border-color:#ff7a1a30; border-radius:18px 4px 18px 18px; background:color-mix(in srgb,var(--orange) 12%,var(--surface)); }
.ai-help-quick-replies { display:flex; flex-wrap:wrap; gap:8px; max-width:100%; }
.ai-help-chip { max-width:100%; min-height:42px; padding:10px 14px; border:1px solid var(--line); border-radius:999px; background:var(--panel); color:var(--text); font-size:12px; font-weight:600; line-height:1.4; text-align:left; overflow-wrap:anywhere; }
.ai-help-chip:hover { border-color:#ff7a1a90; background:color-mix(in srgb,var(--orange) 8%,var(--surface)); }
.ai-help-lyrics-card { width:100%; min-width:0; padding:20px; border:1px solid var(--line); border-radius:18px; background:var(--surface); }
.ai-help-lyrics-card h3 { margin:0 0 4px; font-size:17px; }
.ai-help-lyrics-meta { margin:0 0 22px; color:var(--muted); font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.ai-help-lyrics-section { margin:0 0 22px; }
.ai-help-lyrics-section h4 { display:inline-block; margin:0 0 8px; padding:4px 9px; border-radius:7px; background:#ff7a1a12; color:var(--orange); font-size:11px; font-weight:800; }
.ai-help-lyrics-section[data-chorus="true"] h4 { background:color-mix(in srgb,var(--success) 12%,var(--surface)); color:var(--success); }
.ai-help-lyrics-section p { margin:0; font-size:14px; line-height:1.85; white-space:pre-wrap; overflow-wrap:anywhere; }
.ai-help-lyrics-actions { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:9px; padding-top:4px; }
.ai-help-action { min-width:0; min-height:46px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--panel); color:var(--text); font-size:12px; font-weight:700; line-height:1.4; }
.ai-help-action.ai-help-primary { grid-column:1/-1; border-color:transparent; color:#fff; background:linear-gradient(110deg,#e06515,#c65013); }
.ai-help-use { grid-column:1/-1; background:var(--text); color:var(--panel); border-color:transparent; }
.ai-help-action.is-copied { animation:aiHelpCopied .35s ease-out; }
@keyframes aiHelpCopied { 50% { filter:brightness(1.18); } }
.ai-help-composer { display:grid; flex-shrink:0; grid-template-columns:minmax(0,1fr) 46px; align-items:end; gap:8px; padding:12px 20px max(14px,env(safe-area-inset-bottom,0px)); border-top:1px solid var(--line-soft); background:var(--panel); }
.ai-help-composer textarea { width:100%; min-width:0; min-height:46px; max-height:112px; padding:11px 14px; border:1px solid var(--line); border-radius:16px; background:var(--surface); color:var(--text); font-size:16px; line-height:1.5; resize:none; outline:none; }
.ai-help-composer textarea:focus { border-color:var(--muted); box-shadow:inset 0 0 0 1px var(--muted); outline:none; }
.ai-help-composer p { grid-column:1/-1; margin:1px 0 0; color:var(--muted); font-size:10px; line-height:1.5; }
.ai-help-send { display:grid; place-items:center; width:46px; height:46px; padding:0; border:0; border-radius:15px; color:#fff; background:linear-gradient(110deg,#e06515,#c65013); font-size:27px; font-weight:700; }
.ai-help-error { flex-shrink:0; margin:0; padding:10px 20px; background:color-mix(in srgb,var(--danger) 8%,var(--panel)); color:var(--danger); font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.ai-help-typing { display:flex; flex-shrink:0; align-items:center; gap:9px; min-height:30px; padding:4px 20px 9px; color:var(--muted); font-size:11px; }
.ai-help-typing > span { display:flex; gap:3px; }
.ai-help-typing i { width:4px; height:4px; border-radius:50%; background:var(--orange); animation:aiHelpTyping 1.2s infinite; }
.ai-help-typing i:nth-child(2) { animation-delay:.15s; }
.ai-help-typing i:nth-child(3) { animation-delay:.3s; }
@keyframes aiHelpTyping { 50% { opacity:.25; } }
.ai-help-dialog button:disabled { opacity:.5; cursor:not-allowed; }
.ai-help-dialog :is(button,.ai-help-thread):focus-visible { outline:2px solid currentColor; outline-offset:-4px; }
.ai-help-copy-fallback { position:fixed; top:0; left:0; width:1px; height:1px; padding:0; opacity:0; font-size:16px; }
@media (max-width:900px) {
  .ai-help-dialog { width:100%; height:var(--ai-help-height); border:0; border-radius:0; }
  .ai-help-dialog[open] { top:var(--ai-help-top) !important; }
  .ai-help-header { padding-top:max(14px,env(safe-area-inset-top,0px)); }
  .ai-help-thread { padding-block:20px; }
  .ai-help-entry { max-width:100%; }
}
@media (max-height:440px) {
  .ai-help-header { padding-block:8px; }
  .ai-help-header p,.ai-help-composer p { display:none; }
  .ai-help-toolbar { padding-block:4px; }
  .ai-help-composer { padding-top:8px; padding-bottom:8px; }
}
@media (prefers-reduced-motion:reduce) { .ai-help-typing i,.ai-help-action.is-copied { animation:none; } }
