/* =========================================================================
   DOUBLE — Studio
   Direction artistique : noir profond + orange incandescent. Mêmes gestes
   que la famille Casa Una (dégradé, halo, reflet qui balaie le menu),
   typographie Cormorant Garamond pour les titres, système pour le texte.
   ========================================================================= */
:root {
  --bg: #0f0e0c; --panel: #181614; --panel-2: #201c19; --ink: #f4efe7; --ink2: #c8c0b5; --muted: #8b847a;
  --line: #2b2622; --line-soft: #231f1b;
  --orange: #ff7a1a; --orange-lt: #ffb067; --orange-dk: #c2520a; --orange-deep: #7a2f05;
  --grad: linear-gradient(135deg, #ffb067 0%, #ff7a1a 46%, #d85a08 100%);
  --soft: rgba(255,122,26,.16);
  --glow: 0 6px 22px rgba(255,122,26,.38), 0 1px 0 rgba(255,255,255,.25) inset;
  --blue: #5b8cff; --green: #2ecc8a; --amber: #ffb020; --red: #ff6b5e; --purple: #a48cff;
  --ig: #ff4d8d; --tt: #111; --fb: #4d8dff;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sidebar-w: 256px; --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; font-size: 14px; overflow-x: hidden; min-height: 100dvh; }
img, video, svg { max-width: 100%; }
/* Enfants de grilles et de flex : jamais plus larges que leur colonne (sinon iOS dézoome toute la page) */
.grid > *, .row > *, .detail > *, .dash-grid > *, .vbody, .vbody > *, .meta > *, .card { min-width: 0; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
a { text-decoration: none; color: inherit; }
input, select, textarea, button { font-family: inherit; font-size: 14px; color: inherit; }
.hidden { display: none !important; }
h1, h2, h3 { font-weight: 600; }
.serif { font-family: var(--font-display); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.errtxt { color: var(--red); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
::selection { background: rgba(255,122,26,.35); }

/* =========================== BOUTONS =========================== */
.btn { position: relative; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  padding: 9px 15px; border-radius: 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .16s;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; line-height: 1.2; }
.btn:hover { border-color: rgba(255,176,103,.6); background: #262220; color: var(--orange-lt); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--grad); border: 1px solid #e0661a; color: #1a0d02; box-shadow: var(--glow); text-shadow: 0 1px 0 rgba(255,255,255,.25); }
.btn.primary:hover { color: #1a0d02; border-color: #ff9a4a; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(255,122,26,.5), 0 1px 0 rgba(255,255,255,.35) inset; }
.btn.primary::after { content: ''; position: absolute; top: -60%; left: -80%; width: 45%; height: 220%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent); transform: skewX(-22deg); pointer-events: none; animation: sweep 5.5s ease-in-out infinite; }
@keyframes sweep { 0% { left: -80%; } 55%, 100% { left: 160%; } }
.btn.ghost-gold { background: rgba(255,122,26,.10); border-color: rgba(255,122,26,.38); color: var(--orange-lt); }
.btn.danger:hover { border-color: rgba(255,107,94,.55); background: rgba(255,107,94,.10); color: var(--red); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .btn.primary::after { animation: none; } }

/* =========================== CHARPENTE =========================== */
.app { display: flex; min-height: 100vh; }
aside { width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 40;
  background: linear-gradient(115deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 26%, rgba(255,255,255,.04) 42%, rgba(255,255,255,0) 60%, rgba(255,122,26,.10) 80%, rgba(255,255,255,.03) 96%),
    radial-gradient(520px 320px at 84% -6%, rgba(255,122,26,.42), transparent 62%),
    radial-gradient(460px 520px at -18% 106%, rgba(216,90,8,.28), transparent 64%),
    linear-gradient(172deg, #1c1714 0%, #171311 30%, #13100d 60%, #100d0a 84%, #0c0a08 100%);
  border-right: 1px solid rgba(255,122,26,.22); box-shadow: inset -1px 0 0 rgba(255,255,255,.04), 2px 0 24px rgba(0,0,0,.45); }
aside::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 38%, rgba(255,176,103,.22) 48%, rgba(255,122,26,.10) 54%, transparent 64%); transform: translateX(-130%); animation: asideshine 9s ease-in-out infinite; }
@keyframes asideshine { 0%, 55% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
.brandbox { padding: 26px 22px 18px; border-bottom: 1px solid rgba(255,122,26,.18); position: relative; }
.logo { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: .22em; line-height: 1; color: var(--ink); }
.logo b { color: var(--orange); text-shadow: 0 0 18px rgba(255,122,26,.45); }
.brandbox .st { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--orange-lt); margin-top: 6px; }
.nav-close { display: none; position: absolute; right: 12px; top: 14px; background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--ink2); }
nav { padding: 14px 12px; flex: 1; position: relative; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; cursor: pointer; color: var(--ink2); font-weight: 600; font-size: 13.5px; transition: .15s; margin-bottom: 3px; border: 1px solid transparent; }
.nav-item .ic { width: 22px; text-align: center; font-size: 16px; }
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.nav-item.active { background: rgba(255,122,26,.14); color: var(--orange-lt); border-color: rgba(255,122,26,.42); box-shadow: 0 4px 16px rgba(0,0,0,.3), 0 0 0 1px rgba(255,122,26,.08) inset; }
.nav-item .badge-n { margin-left: auto; background: var(--grad); color: #1a0d02; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.nav-sep { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,176,103,.7); padding: 14px 12px 6px; }
.aside-foot { padding: 14px 18px 20px; border-top: 1px solid rgba(255,122,26,.18); font-size: 12px; color: var(--ink2); position: relative; }
.aside-foot .status { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.07); }
.dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot.ok::before { background: var(--green); box-shadow: 0 0 8px rgba(46,204,138,.6); } .dot.ko::before { background: var(--red); }

main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top, 0px)) 26px 14px; background: rgba(15,14,12,.86); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); }
.topbar h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.burger { display: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; width: 38px; height: 36px; font-size: 18px; cursor: pointer; }
#page { padding: 22px 26px 60px; max-width: 1380px; }

/* =========================== COMPOSANTS =========================== */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 2px 14px rgba(0,0,0,.25); }
.card h2 { font-family: var(--font-display); font-size: 21px; margin-bottom: 10px; }
.card h3 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--orange-lt); margin: 14px 0 8px; }
.card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; position: relative; overflow: hidden; cursor: pointer; transition: .15s; }
.kpi:hover { border-color: rgba(255,122,26,.5); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,122,26,.12); }
.kpi .v { font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1; color: var(--ink); }
.kpi .l { font-size: 12px; color: var(--ink2); margin-top: 6px; font-weight: 600; }
.kpi .s { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.kpi::after { content: ''; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(circle, rgba(255,122,26,.35), rgba(255,122,26,.06)); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--ink2); letter-spacing: .02em; white-space: nowrap; }
.pill.nouvelle, .pill.queued { background: rgba(91,140,255,.18); color: #9db7ff; }
.pill.analyse, .pill.generating, .pill.processing, .pill.programmee { background: rgba(255,176,32,.18); color: #ffcf6b; }
.pill.prete, .pill.ready, .pill.publiee { background: rgba(46,204,138,.18); color: #6fe3b1; }
.pill.en_production { background: rgba(164,140,255,.18); color: #c4b5ff; }
.pill.produite { background: rgba(60,190,230,.18); color: #8be0f5; }
.pill.erreur, .pill.failed, .pill.echec { background: rgba(255,107,94,.18); color: #ffa39a; }
.pill.archivee, .pill.brouillon { background: rgba(255,255,255,.08); color: #a39b90; }
.pill.excellent { background: rgba(46,204,138,.18); color: #6fe3b1; } .pill.bon { background: rgba(255,176,32,.18); color: #ffcf6b; } .pill.à { background: rgba(255,107,94,.18); color: #ffa39a; }
.plat { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; color: #fff; text-transform: capitalize; }
.plat.instagram { background: linear-gradient(45deg, #f09433, #dc2743 60%, #bc1888); } .plat.tiktok { background: #000; border: 1px solid #3a3a3a; } .plat.facebook { background: #1877f2; } .plat.youtube { background: #e62117; } .plat.autre { background: #555; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=text], .toolbar input[type=url], .toolbar select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: 150px; width: auto; }
.toolbar input[type=url] { flex: 1 1 320px; min-width: 240px; }
.toolbar input[type=text] { flex: 0 1 220px; }
input[type=text], input[type=url], input[type=password], input[type=number], input[type=datetime-local], select, textarea { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; transition: .15s; color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--soft); }
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input[type=file] { color: var(--ink2); }
label.f { display: block; font-size: 12px; font-weight: 700; color: var(--ink2); margin: 10px 0 5px; letter-spacing: .02em; }
label.f:first-child { margin-top: 0; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.chk { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; padding: 6px 0; cursor: pointer; }
.chk input { width: auto; accent-color: var(--orange); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); border: 1px dashed #3a332d; border-radius: var(--radius); background: rgba(255,255,255,.02); }
.empty .big { font-size: 34px; margin-bottom: 8px; }
.empty h3 { color: var(--ink); font-family: var(--font-display); font-size: 22px; letter-spacing: 0; text-transform: none; margin: 0 0 6px; }
.feed li span:nth-child(2) { overflow-wrap: anywhere; }

/* ---- Vignettes vidéo 9:16 ---- */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; transition: .18s; display: flex; flex-direction: column; }
.vcard:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,.45), 0 0 0 1px rgba(255,122,26,.35); border-color: rgba(255,122,26,.5); }
.thumb { position: relative; aspect-ratio: 9 / 16; background: linear-gradient(160deg, #2a2521, #171412); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ov { position: absolute; left: 8px; top: 8px; display: flex; gap: 5px; }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.thumb .st { position: absolute; left: 8px; bottom: 8px; }
.thumb .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; opacity: .35; }
.thumb .spin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
.vbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.vbody .t { font-weight: 700; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vbody .m { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--orange); }

/* ---- Détail (2 colonnes) ---- */
.detail { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.player { background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 9/16; max-height: min(640px, 78dvh); margin: 0 auto; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 9px 14px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--orange-lt); border-color: var(--orange); }
.timeline { display: flex; flex-direction: column; gap: 6px; }
.tl { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px 10px; background: var(--panel-2); border-radius: 10px; border: 1px solid var(--line-soft); }
.tl .t { font-weight: 800; color: var(--orange-lt); font-size: 12px; } .tl .w { font-size: 13px; line-height: 1.4; }
.tl .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.hookbox { background: linear-gradient(135deg, rgba(255,122,26,.18), rgba(255,122,26,.05)); border: 1px solid rgba(255,122,26,.38); border-radius: 12px; padding: 12px 14px; font-family: var(--font-display); font-size: 20px; line-height: 1.25; }
.taglist { display: flex; gap: 6px; flex-wrap: wrap; }
.taglist span { background: rgba(255,255,255,.07); border-radius: 7px; padding: 3px 8px; font-size: 12px; font-weight: 600; color: var(--ink2); }
ul.clean { list-style: none; } ul.clean li { padding: 5px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
ul.clean li::before { content: '◆ '; color: var(--orange); font-size: 9px; vertical-align: middle; }
.transcript { white-space: pre-wrap; line-height: 1.6; font-size: 13.5px; color: var(--ink2); max-height: 420px; overflow: auto; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12.5px; }
.meta b { color: var(--muted); font-weight: 600; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.spec { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 10px; }
.spec .k { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); } .spec .v { font-weight: 700; font-size: 14px; margin-top: 2px; }
.issue { font-size: 12.5px; color: #ffcf6b; background: rgba(255,176,32,.14); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.okline { font-size: 12.5px; color: #6fe3b1; background: rgba(46,204,138,.14); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.platbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--panel); }
.platbox.on { border-color: var(--orange); box-shadow: 0 0 0 3px var(--soft); }
.platbox textarea { min-height: 110px; margin-top: 8px; font-size: 13px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255,255,255,.03); }
.tbl img.mini { width: 36px; height: 64px; object-fit: cover; border-radius: 6px; }
.feed { list-style: none; } .feed li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12.5px; }
.feed .k { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--muted); }
.feed .k.ok { background: var(--green); } .feed .k.warn { background: var(--amber); } .feed .k.error { background: var(--red); } .feed .k.info { background: var(--blue); }
.feed .d { color: var(--muted); margin-left: auto; white-space: nowrap; }
.avatar-img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; background: var(--panel-2); display: block; }
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.step { flex: 1; min-width: 140px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.step.on { border-color: var(--orange); color: var(--orange-lt); background: rgba(255,122,26,.10); } .step.done { color: #6fe3b1; }
.step .n { display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: var(--panel-2); text-align: center; line-height: 20px; margin-right: 6px; font-size: 11px; }
.step.on .n { background: var(--grad); color: #1a0d02; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pick .vcard.sel { border-color: var(--orange); box-shadow: 0 0 0 3px var(--soft); }
.radio-cards { display: grid; gap: 8px; }
.rc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: 13px; background: var(--panel-2); }
.rc.sel { border-color: var(--orange); background: rgba(255,122,26,.10); box-shadow: 0 0 0 3px var(--soft); }
.rc b { display: block; margin-bottom: 2px; }
.progress { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--grad); width: 0; transition: width .2s; }
.spinner { width: 26px; height: 26px; border: 3px solid rgba(255,122,26,.25); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.copy { cursor: pointer; }
.callout { background: rgba(255,122,26,.08); border: 1px solid rgba(255,122,26,.30); border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.callout b { color: var(--orange-lt); }
.callout a, .help a { color: var(--orange-lt); }
code.k { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* ---- Modales & toasts ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.62); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(4px); }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto; -webkit-overflow-scrolling: touch; padding: 22px 22px 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal.wide { max-width: 900px; }
.modal h2 { font-family: var(--font-display); font-size: 24px; margin-bottom: 12px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.toasts { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 18px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { background: #2a2521; color: var(--ink); border: 1px solid var(--line); padding: 11px 15px; border-radius: 11px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: pop .2s ease-out; max-width: 380px; }
.toast.err { background: #8c2a22; border-color: #b23a30; color: #fff; } .toast.ok { background: #1b6b48; border-color: #24885c; color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---- Connexion ---- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(700px 500px at 80% -10%, rgba(255,122,26,.35), transparent 60%), radial-gradient(600px 600px at -10% 110%, rgba(216,90,8,.22), transparent 60%), var(--bg); }
.login .box { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 36px 34px; width: 100%; max-width: 400px; box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,122,26,.12); text-align: center; }
.login .logo { font-size: 40px; }
.login p { color: var(--ink2); margin: 8px 0 20px; font-size: 13.5px; }
.login input { text-align: center; font-size: 16px; margin-bottom: 12px; }

/* ---- Tablette ---- */
@media (max-width: 960px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .player { max-height: min(560px, 72dvh); }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Téléphone ---- */
@media (max-width: 760px) {
  aside { position: fixed; left: 0; top: 0; height: 100dvh; padding-top: env(safe-area-inset-top, 0px); transform: translateX(-105%); transition: transform .22s; width: min(290px, 84vw); box-shadow: 0 0 40px rgba(0,0,0,.6); }
  aside.open { transform: translateX(0); }
  .nav-close { display: block; top: calc(14px + env(safe-area-inset-top, 0px)); }
  .burger { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .topbar { padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; gap: 8px; }
  .topbar h1 { font-size: 21px; }
  #topActions .btn { padding: 7px 10px; font-size: 12.5px; }
  #page { padding: 14px 14px calc(70px + env(safe-area-inset-bottom, 0px)); }
  .card { padding: 14px 14px; border-radius: 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .v { font-size: 28px; }
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .toolbar { gap: 8px; }
  .toolbar input[type=url], .toolbar input[type=text] { flex: 1 1 100%; min-width: 0; width: 100%; }
  .toolbar select { flex: 1 1 auto; min-width: 0; }
  .meta { grid-template-columns: 1fr; gap: 2px 0; }
  .meta b { margin-top: 6px; }
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl { grid-template-columns: 52px 1fr; }
  .hookbox { font-size: 18px; }
  .modal-bg { padding: 10px; align-items: flex-end; }
  .modal { padding: 18px 16px 14px; max-height: 94dvh; border-radius: 18px 18px 14px 14px; }
  .modal .actions .btn { flex: 1 1 auto; justify-content: center; }
  .btn.primary.block, .login .btn { min-height: 46px; }
  .player { max-height: min(560px, 68dvh); }
  .nav-item { padding: 12px 12px; }
  .row.between > .btn { flex-shrink: 0; }
}

/* ---- Écrans tactiles : police 16 px dans les champs, sinon iOS zoome à chaque saisie ---- */
@media (hover: none) and (pointer: coarse) {
  input[type=text], input[type=url], input[type=password], input[type=number], input[type=datetime-local], select, textarea, .toolbar input, .toolbar select { font-size: 16px; }
  .btn { min-height: 40px; }
  .btn.xs { min-height: 32px; }
}

/* ---- Studio : liste des idées + colonne « en production » ---- */
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
@media (max-width: 960px) { .studio-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Galerie de photos d'un avatar ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
.gthumb { position: relative; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--panel-2); cursor: pointer; }
.gthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gthumb.main { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255,122,26,.25); }
.gthumb .gdel { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 10px; line-height: 18px; cursor: pointer; padding: 0; opacity: 0; transition: .15s; }
.gthumb:hover .gdel { opacity: 1; }
@media (hover: none) { .gthumb .gdel { opacity: .85; } }
.gadd { aspect-ratio: 3/4; border-radius: 8px; border: 1px dashed rgba(255,122,26,.45); color: var(--orange-lt); display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; background: rgba(255,122,26,.06); }
.gadd:hover { background: rgba(255,122,26,.14); }
