:root{font-family:Inter,Arial,sans-serif;background:#f7f8fa;color:#111827}
*{box-sizing:border-box}body{margin:0;background:#f7f8fa}button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.55}code{font-family:monospace}
.shell{min-height:100vh;display:grid;grid-template-columns:245px 1fr}
.side{position:sticky;top:0;height:100vh;background:#fff;border-right:1px solid #e5e7eb;padding:20px 15px;display:flex;flex-direction:column}
.brand{display:flex;gap:10px;align-items:center;padding:4px 8px 22px;border-bottom:1px solid #eef0f3}.brand>b{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#2563eb;color:#fff}.brand span{font-weight:800;line-height:1.05}.brand small{color:#9ca3af}
.side nav{display:flex;flex-direction:column;gap:6px;padding-top:18px}.side nav button{border:0;background:transparent;text-align:left;padding:11px 12px;border-radius:10px;color:#4b5563;font-weight:700;display:flex;align-items:center;gap:8px}.side nav .on{background:#eff6ff;color:#1d4ed8}
.pill{margin-left:auto;font-style:normal;background:#16a34a;color:#fff;border-radius:999px;padding:2px 8px;font-size:11px}.pill.soft{background:#dbeafe;color:#1d4ed8}
.api{border-top:1px solid #eef0f3;padding:12px 8px;color:#6b7280;font-size:12px;font-weight:700;display:flex;gap:8px;align-items:center}.side .api:first-of-type{margin-top:auto}
.api i,.connect i{width:8px;height:8px;border-radius:50%;background:#9ca3af;flex:none}.api i.green,.connect i.green{background:#22c55e}.api i.blue,.connect i.blue{background:#2563eb}
.main{padding:32px 38px 90px;max-width:1540px;width:100%}
header{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:26px;gap:16px}header p{margin:0 0 6px;color:#6b7280;font-size:11px;font-weight:800;letter-spacing:.08em}
h1{margin:0;font-size:32px}h2{margin:0;font-size:18px}p{color:#6b7280}
.hactions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.dark{border:0;background:#111827;color:#fff;border-radius:10px;padding:11px 14px;font-weight:800}
.notice{padding:12px 44px 12px 14px;border:1px solid #c7d7fe;background:#eef4ff;color:#1e40af;border-radius:12px;margin-bottom:18px;font-size:13px;font-weight:700;position:relative}.notice.error{border-color:#fecaca;background:#fef2f2;color:#991b1b}.notice .x{position:absolute;right:8px;top:6px;border:0;background:transparent;font-size:18px;color:inherit}
.stack{display:flex;flex-direction:column;gap:18px}
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.kpis article{min-height:122px;background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:18px;display:flex;flex-direction:column}.kpis span{color:#6b7280;font-size:12px;font-weight:700}.kpis b{font-size:30px;margin-top:auto}.kpis small{color:#9ca3af}.kpis .blue{background:#2563eb;color:#fff;border-color:#2563eb}.kpis .blue span,.kpis .blue small{color:#dbeafe}
.panel{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:20px}.panel>p,.head p{font-size:13px;margin:5px 0 0}
.head{display:flex;justify-content:space-between;gap:14px;align-items:center;margin-bottom:17px}.head.wrap{flex-wrap:wrap}
em{font-style:normal}.head>em,.summary em,.source em,td em,.row em,.state em{background:#ecfdf5;color:#166534;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:800;white-space:nowrap;display:inline-flex;align-items:center;gap:6px}em.idle{background:#f3f4f6;color:#6b7280}em.err{background:#fef2f2;color:#b91c1c}em.run{background:#eff6ff;color:#1d4ed8}em.off{background:#f3f4f6;color:#6b7280}
.spin{width:10px;height:10px;border:2px solid #bfdbfe;border-top-color:#1d4ed8;border-radius:50%;display:inline-block;animation:sp .8s linear infinite}@keyframes sp{to{transform:rotate(360deg)}}
.link{border:0;background:transparent;color:#2563eb;font-weight:800}
.steps{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:18px}.steps div{border-top:2px solid #d1d5db;padding:12px 6px 4px 0;display:grid;gap:5px}.steps div.done{border-color:#2563eb}.steps div>b,.steps small{font-size:11px;color:#9ca3af}.steps span{font-weight:800}
.summary{display:grid;grid-template-columns:1fr auto auto auto;gap:14px;align-items:center;padding:12px 0;border-top:1px solid #eef0f3}.summary>div:first-child{display:flex;flex-direction:column;gap:3px}.summary small{color:#9ca3af}
.counts{display:flex;gap:14px;font-size:12px;color:#6b7280}.counts b{color:#111827;font-size:14px}
.add{display:grid;grid-template-columns:260px 1fr;gap:24px}.form{display:grid;grid-template-columns:1fr 150px;gap:11px;align-items:end}.wide{grid-column:1/-1}
label{display:flex;flex-direction:column;gap:7px;color:#374151;font-size:12px;font-weight:800}input,select{border:1px solid #d1d5db;border-radius:9px;padding:10px 11px;background:#fff;color:#111827;outline:none;width:100%}
.primary{border:0;background:#2563eb;color:#fff;border-radius:9px;padding:11px 13px;font-weight:800}.save{margin-top:12px}
.vform{display:flex;flex-direction:column;gap:12px;margin-top:16px;max-width:420px}.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.sources{display:flex;flex-direction:column;gap:10px}
.source{display:grid;grid-template-columns:42px minmax(250px,1fr) 90px auto;gap:14px;align-items:center;border:1px solid #e5e7eb;border-radius:12px;padding:14px}.source.off{opacity:.6}
.avatar{width:42px;height:42px;display:grid;place-items:center;background:#eff6ff;color:#1d4ed8;border-radius:10px;font-weight:900;overflow:hidden}.avatar img{width:100%;height:100%;object-fit:cover}
.grow p{margin:4px 0;font-size:12px}.grow a{font-size:12px;color:#2563eb;text-decoration:none}.state{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.count{display:flex;flex-direction:column;align-items:flex-end}.count b{font-size:23px}.count small{color:#9ca3af;white-space:nowrap}
.actions{display:flex;gap:6px;flex-wrap:wrap}.actions.col{flex-direction:column;align-items:stretch}.actions button,.import button,.hactions>button{border:1px solid #dbeafe;background:#eff6ff;color:#1d4ed8;border-radius:8px;padding:8px 10px;font-size:12px;font-weight:800;white-space:nowrap}.actions .red{border:0;background:transparent;color:#dc2626}.actions .primary{background:#2563eb;color:#fff;border-color:#2563eb}
.errtxt{display:block;color:#b91c1c;font-size:11px;margin-top:4px}.oktxt{display:block;color:#166534;font-size:11px;margin-top:4px}
.info{border:1px solid #bfdbfe;background:#eff6ff;color:#1e3a8a;border-radius:14px;padding:18px}.info p{margin:5px 0 0;color:#3b5d94;font-size:13px}
.settings{display:grid;grid-template-columns:1fr 1fr;gap:18px}.rule{margin-top:18px;padding:14px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;color:#4b5563;font-size:13px}
.connect{margin:16px 0;padding:14px;border:1px solid #e5e7eb;border-radius:10px;display:flex;gap:9px;align-items:center}
.empty{padding:28px;text-align:center;color:#6b7280;font-size:13px;border:1px dashed #d1d5db;border-radius:12px}
/* comptes (chips) */
.chips{display:flex;gap:8px;flex-wrap:wrap}.chip{border:1px solid #e5e7eb;background:#fff;border-radius:999px;padding:8px 12px;font-weight:800;font-size:12px;color:#374151;display:inline-flex;gap:8px;align-items:center}.chip.on{background:#111827;color:#fff;border-color:#111827}.chip i{font-style:normal;background:rgba(0,0,0,.08);border-radius:999px;padding:1px 7px;font-size:11px}.chip.on i{background:rgba(255,255,255,.2)}
.seg{display:inline-flex;border:1px solid #e5e7eb;border-radius:9px;overflow:hidden;background:#fff}.seg button{border:0;background:transparent;padding:8px 11px;font-size:12px;font-weight:800;color:#4b5563}.seg .on{background:#111827;color:#fff}
/* grille de publicités */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}
.ad{position:relative;border:1px solid #e5e7eb;border-radius:14px;overflow:hidden;background:#fff;display:flex;flex-direction:column;transition:box-shadow .15s,border-color .15s}.ad:hover{box-shadow:0 6px 24px rgba(17,24,39,.08)}
.ad.st-selected{border-color:#2563eb;box-shadow:0 0 0 2px #dbeafe}.ad.st-ready,.ad.st-pushing{border-color:#16a34a;box-shadow:0 0 0 2px #dcfce7}.ad.st-pushed{border-color:#111827}.ad.inactive{background:#fafafa}.ad.inactive .thumb img{filter:grayscale(.35)}.ad.inactive .ad-top small{color:#b45309}
.check{position:absolute;top:10px;left:10px;z-index:2;cursor:pointer}.check input{position:absolute;opacity:0;width:0;height:0}.check span{display:block;width:26px;height:26px;border-radius:8px;background:#fff;border:2px solid #9ca3af;box-shadow:0 1px 4px rgba(0,0,0,.2)}.check input:checked+span{background:#2563eb;border-color:#2563eb}.check input:checked+span::after{content:"";position:absolute;left:9px;top:4px;width:6px;height:12px;border:solid #fff;border-width:0 3px 3px 0;transform:rotate(45deg)}.check input:disabled+span{opacity:.6;background:#16a34a;border-color:#16a34a}
.thumb{position:relative;aspect-ratio:1.2;background:#111827 linear-gradient(0deg,#0f172a,#1f2937);display:grid;place-items:center;overflow:hidden}.thumb img{width:100%;height:100%;object-fit:cover}.thumb.small{width:120px;aspect-ratio:1;border-radius:10px;flex:none}
.nothumb{color:#9ca3af;font-size:12px;font-weight:700}
.play{position:absolute;left:50%;top:50%;width:46px;height:46px;margin:-23px 0 0 -23px;border-radius:50%;background:rgba(255,255,255,.92);box-shadow:0 2px 10px rgba(0,0,0,.3)}.play::after{content:"";position:absolute;left:18px;top:13px;border-left:16px solid #111827;border-top:10px solid transparent;border-bottom:10px solid transparent}.thumb.small .play{width:30px;height:30px;margin:-15px 0 0 -15px}.thumb.small .play::after{left:11px;top:8px;border-left-width:11px;border-top-width:7px;border-bottom-width:7px}
.more{position:absolute;right:8px;bottom:8px;background:rgba(17,24,39,.85);color:#fff;font-size:11px;font-weight:800;border-radius:999px;padding:3px 8px;font-style:normal}
.ad-body{padding:14px;display:flex;flex-direction:column;gap:7px;flex:1}.ad-top{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}.ad-top small{color:#9ca3af;font-size:11px}
.ad-body>b{font-size:14px;line-height:1.3}.ad-body p{margin:0;font-size:12px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:auto;padding-top:6px}.tag{background:#f3f4f6;color:#374151;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:700}.tag.cta{background:#eff6ff;color:#1d4ed8}.tag.soft{background:#fff;border:1px solid #e5e7eb;color:#6b7280}.tag.warn{background:#fef3c7;color:#92400e}
.ad-foot{font-size:11px;color:#9ca3af}.ad-foot a{color:#2563eb;text-decoration:none}
.badge{border-radius:999px;padding:4px 9px;font-size:11px;font-weight:800;background:#f3f4f6;color:#6b7280}.badge.selected{background:#dbeafe;color:#1d4ed8}.badge.syncing,.badge.pushing{background:#fef3c7;color:#92400e}.badge.ready{background:#dcfce7;color:#166534}.badge.pushed{background:#111827;color:#fff}
.stickybar{position:sticky;bottom:14px;background:#111827;color:#fff;border-radius:14px;padding:12px 16px;display:flex;justify-content:space-between;align-items:center;gap:12px;box-shadow:0 10px 30px rgba(17,24,39,.3);z-index:5}.stickybar .actions button{background:rgba(255,255,255,.1);color:#fff;border-color:transparent}.stickybar .actions .primary{background:#2563eb}
/* prêtes à pousser */
.rows{display:flex;flex-direction:column;gap:12px}.row{display:grid;grid-template-columns:120px 1fr auto;gap:16px;border:1px solid #e5e7eb;border-radius:14px;padding:14px;align-items:start}.row.st-pushed{background:#f9fafb}.row .grow>b{display:block;font-size:14px;margin-top:6px}.row .grow p{font-size:12px;margin:4px 0 0}
.pkg{margin-top:12px;padding:14px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;font-size:12px}.pkg dl{margin:0;display:grid;grid-template-columns:130px 1fr;gap:6px 12px}.pkg dt{color:#6b7280;font-weight:800}.pkg dd{margin:0;color:#111827;white-space:pre-wrap;word-break:break-word}.pkg ul{margin:0;padding-left:16px}
@media(max-width:1000px){.shell{grid-template-columns:1fr}.side{position:static;height:auto;border-right:0;border-bottom:1px solid #e5e7eb}.side nav{flex-direction:row;overflow:auto}.side nav button{white-space:nowrap}.api{display:none}.main{padding:24px 18px 90px}.kpis,.steps{grid-template-columns:1fr 1fr}.add,.settings{grid-template-columns:1fr}.source{grid-template-columns:42px 1fr 60px}.actions{grid-column:2/-1}.summary{grid-template-columns:1fr auto}.counts{grid-column:1/-1}}
@media(max-width:650px){header{align-items:flex-start;flex-direction:column}.kpis,.steps,.form,.two{grid-template-columns:1fr}.wide{grid-column:auto}.source{grid-template-columns:42px 1fr}.count{display:none}.actions{grid-column:1/-1}.row{grid-template-columns:1fr}.thumb.small{width:100%;aspect-ratio:1.6}.stickybar{flex-direction:column;align-items:stretch}}

.suggest{display:flex;flex-direction:column;gap:8px}.sug{display:grid;grid-template-columns:42px 1fr auto;gap:12px;align-items:center;border:1px solid #e5e7eb;border-radius:12px;padding:10px 12px}.sug p{margin:3px 0 0;font-size:12px}.sug button{border:1px solid #dbeafe;background:#eff6ff;color:#1d4ed8;border-radius:8px;padding:8px 10px;font-size:12px;font-weight:800;white-space:nowrap}.sug button.primary{background:#2563eb;color:#fff}.empty .spin{vertical-align:middle;margin-right:6px}
@media(max-width:650px){.sug{grid-template-columns:42px 1fr}.sug button{grid-column:1/-1}}

/* éditeur rapide */
.overlay{position:fixed;inset:0;background:rgba(17,24,39,.45);z-index:50;display:grid;place-items:center;padding:20px;overflow:auto}
.modal{background:#fff;border-radius:16px;padding:22px;width:min(720px,100%);box-shadow:0 30px 80px rgba(0,0,0,.35);max-height:calc(100vh - 40px);overflow:auto}
.modal .head{margin-bottom:12px}.modal .x{border:0;background:#f3f4f6;border-radius:8px;width:32px;height:32px;font-size:18px;color:#374151}
.vform.wide{max-width:none}textarea{border:1px solid #d1d5db;border-radius:9px;padding:10px 11px;background:#fff;color:#111827;outline:none;width:100%;font:inherit;resize:vertical}
label small{font-weight:600;color:#9ca3af}label>span .tag{margin-left:6px;font-size:10px;padding:2px 6px;font-style:normal;vertical-align:middle}
.actions button[type=button]{border:1px solid #e5e7eb;background:#fff;color:#374151}
.ad-foot a[data-edit]{font-weight:800}

.actions select{border:1px solid #e5e7eb;border-radius:8px;padding:8px 9px;font-size:12px;font-weight:800;color:#374151;background:#fff;width:auto}.empty .mt{margin-top:10px}

.dest{display:flex;gap:8px;align-items:baseline;font-size:12px;padding:8px 10px;border:1px solid #e5e7eb;border-radius:9px;background:#f8fafc;margin-top:2px;min-width:0}.dest span{color:#6b7280;font-weight:800;white-space:nowrap}.dest a{color:#1d4ed8;font-weight:700;text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dest.edited{border-color:#fcd34d;background:#fffbeb}.dest.edited span{color:#92400e}.dest.warn{border-color:#fecaca;background:#fef2f2}.dest.warn em{color:#b91c1c;font-weight:700}
.ad-foot{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.mini{border:1px solid #dbeafe;background:#eff6ff;color:#1d4ed8;border-radius:8px;padding:6px 9px;font-size:11px;font-weight:800}
.mini.dl{background:#111827;color:#fff;border-color:#111827}
