/* Onglets Montage vidéo / Retouche photos, éditeur photo et agents IA. Commun au studio web et à Gesti-Motion. */

/* Sélecteur d'onglet */
.mode-switch { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex-shrink: 0; }
.mode-switch button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.mode-switch button.on { background: var(--grad, var(--accent)); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.photo-only { display: none !important; }
body.mode-photo .photo-only { display: revert !important; }
body.mode-photo main.photo-only { display: grid !important; }
body.mode-photo .photo-top { display: flex !important; }
body.mode-photo .video-only, body.mode-photo .workspace:not(.photo-only), body.mode-photo .timeline-area { display: none !important; }
body.mode-photo { grid-template-rows: 52px 1fr 34px; }
.photo-top { align-items: center; gap: 6px; }

/* Éditeur photo */
#photo-app { grid-template-columns: 300px 1fr 300px; min-height: 0; }
.ph-left, .ph-right { overflow: hidden; }
.ph-panel { padding: 0; }
.ph-section { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.ph-section h4 { margin: 0 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.ph-slider label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.ph-slider label b { color: var(--text); font-variant-numeric: tabular-nums; }
.ph-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ph-row select { flex: 1; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 5px; }
button.chip { border-radius: 999px; padding: 4px 10px; font-size: 12px; background: var(--bg-3); }
button.chip.on, button.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 22%, var(--bg-3)); }
button.wide { width: 100%; }
.small { font-size: 12px; }
.ph-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-filter { padding: 4px; display: grid; gap: 4px; border-radius: 8px; }
.ph-filter canvas { width: 100%; height: auto; border-radius: 5px; display: block; }
.ph-filter span { font-size: 11px; color: var(--muted); }
.ph-filter.on { border-color: var(--accent); }
.ph-list { display: grid; gap: 4px; }
.ph-item { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-item.on { border-color: var(--accent); }
.ph-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ph-seg button { font-size: 12px; padding: 6px; }
.ph-online { display: grid; gap: 10px; }
.ph-tool { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 7px; background: var(--bg); }
.ph-tool h5 { margin: 0; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.ph-tool p { margin: 0; }
.ph-lock { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 2px 7px; border-radius: 999px; background: var(--grad, var(--accent)); color: #fff; }
.ph-wrap { padding: 0; }
.ph-wrap canvas { position: absolute; inset: 0; touch-action: none; }
.ph-empty-ico { font-size: 46px; }
.ph-busy { position: absolute; inset: 0; background: rgba(5,6,10,.62); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 5; backdrop-filter: blur(2px); font-weight: 600; }
.ph-busy i { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: ph-spin .8s linear infinite; }
@keyframes ph-spin { to { transform: rotate(360deg); } }
.switch { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* Agents IA */
.ag-open { background: linear-gradient(100deg, #a24dff, #ff3d7f); border: 0; color: #fff; font-weight: 700; border-radius: 999px; padding: 6px 14px; white-space: nowrap; }
.ag-open:hover { filter: brightness(1.1); background: linear-gradient(100deg, #a24dff, #ff3d7f); }
.agents { position: fixed; top: 52px; right: 0; bottom: 34px; width: 410px; max-width: 100vw; background: var(--bg-2); border-left: 1px solid var(--line); z-index: 40;
  display: flex; flex-direction: column; transform: translateX(105%); transition: transform .22s ease; box-shadow: -18px 0 40px rgba(0,0,0,.45); }
.agents.open { transform: none; }
.ag-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 16px 8px; }
.ag-head h3 { margin: 0; font-size: 16px; }
.ag-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.ag-team { display: flex; gap: 6px; padding: 0 16px 10px; border-bottom: 1px solid var(--line); }
.ag-team span { flex: 1; display: grid; justify-items: center; gap: 2px; font-size: 18px; padding: 6px 2px; border-radius: 8px; background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.ag-team em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--c); }
.ag-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ag-msg { display: flex; gap: 8px; align-items: flex-start; }
.ag-msg.me { flex-direction: row-reverse; }
.ag-msg.me .ag-body { background: var(--bg-4); }
.ag-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.ag-body { background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; max-width: 84%; }
.ag-body b { font-size: 11px; display: block; margin-bottom: 2px; }
.ag-text { line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.ag-text p { margin: 0 0 4px; }
.ag-msg.err .ag-body { border-color: #e03131; }
.ag-handoff { margin-left: 38px; border-left: 2px dashed var(--line); padding: 2px 0 2px 10px; font-size: 12px; color: var(--muted); }
.ag-handoff p { margin: 2px 0 0; color: var(--text); opacity: .85; font-style: italic; }
.ag-actions { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12px; }
.ag-actions li::before { content: '⏳ '; }
.ag-actions li.ok::before { content: '✅ '; }
.ag-actions li.ko { color: #ff8787; }
.ag-actions li.ko::before { content: '⚠️ '; }
.ag-summary { text-align: center; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.ag-dots { display: inline-flex; gap: 4px; }
.ag-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ag-blink 1s infinite; }
.ag-dots i:nth-child(2) { animation-delay: .15s; } .ag-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ag-blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.ag-confirm p { margin: 0 0 6px; }
.ag-row { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.ag-row .ag-cost { flex: 1; }
.ag-suggest { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 14px; }
.ag-suggest .chip { text-align: left; font-size: 11px; }
.ag-input { padding: 10px 14px 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.ag-input textarea { min-height: 70px; }

/* En-tête : tout tient sur une ligne avec les deux onglets */
.topbar { gap: 10px; min-width: 0; }
.topbar-actions { gap: 5px; min-width: 0; }
.topbar-actions > button, .topbar-actions > a { white-space: nowrap; }
.topbar-actions select { max-width: 150px; }
.project-name { width: 160px; min-width: 80px; flex-shrink: 1; }
.mode-switch .short { display: none; }
@media (max-width: 1750px) {
  .brand em { display: none; }
  .mode-switch .long { display: none; }
  .mode-switch .short { display: inline; }
  .topbar-actions .ghost { padding: 6px 8px; }
  .topbar-actions select { max-width: 120px; }
}
@media (max-width: 1350px) { .project-name { width: 110px; } .ag-open { padding: 6px 10px; } }
