/* Passe mobile (≤ 700 px, iPhone 390 / Android 412) — chargé en dernier : surcharge les feuilles d'écran.
   Règles : texte ≥ 13 px (champs 16 px, sinon iOS zoome au focus), cibles tactiles ≥ 44 px (40 px pour les puces denses),
   rangées de filtres/onglets en défilement horizontal plutôt qu'en retour à la ligne, encoches (safe-area) respectées.
   Le bureau n'est pas touché : tout est sous @media(max-width:700px), sauf l'éditeur (720 px, son ancien seuil). */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
.auth a.auth-brand.brand-logo{display:none}

@media (max-width:700px){
  body{-webkit-tap-highlight-color:transparent}
  /* champs : 16 px = pas de zoom automatique de Safari iOS au focus */
  input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea{font-size:16px!important}
  input[type=checkbox],input[type=radio]{width:20px;height:20px;flex:none}

  /* ---- barre du haut ---- */
  .header-inner{padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}
  .header .avatar{width:40px;height:40px;font-size:15px}
  .header .lang button{min-width:40px;min-height:40px;font-size:13px}
  .header-link{font-size:15px;font-weight:600;color:var(--text);padding:12px 0}
  .xs-nav-toggle{width:44px!important;height:44px!important;left:7px!important;top:7px!important}
  body:has(.xs-shell) .header-inner{padding-left:58px}
  .xs-nav-close{width:44px!important;height:44px!important;right:6px!important;top:10px!important}
  .xs-sidebar{padding-top:max(18px,env(safe-area-inset-top));box-shadow:0 20px 60px rgba(0,0,0,.18)}
  .xs-sidebar nav>a,.xs-sidebar nav>button{min-height:46px;font-size:15px}
  .xs-help{min-height:44px;font-size:14px!important}
  .menu a,.menu button{min-height:44px;display:flex;align-items:center;font-size:15px}

  /* ---- bulle de support : plus discrète, au-dessus de la barre d'accueil iOS ---- */
  .sup-fab{width:52px!important;height:52px!important;right:14px!important;bottom:calc(14px + env(safe-area-inset-bottom))!important}
  .sup-fab svg{width:22px;height:22px}

  /* ---- typographie des espaces produit (l'ancienne passe mobile descendait à 10–11 px) ---- */
  .xs-hero p{font-size:15px!important;line-height:1.5}
  .xs-eyebrow{font-size:12px!important}
  .xs-create h3{font-size:15px!important}
  .xs-source-options button,.xs-source-options a{font-size:13.5px!important;min-height:52px!important;line-height:1.25}
  .xs-styles legend,.xs-styles label{font-size:13px!important}
  .xs-example{font-size:13px!important;min-height:44px;display:inline-flex;align-items:center}
  .xs-chips button{font-size:13px!important;min-height:40px!important;padding:0 14px}
  .xs-script-hint,.sc-hint{font-size:13px!important;line-height:1.45}
  .xs-param-row .field label{font-size:13px!important}
  .xs-param-row select{height:46px!important}
  .xs-param-row .xs-generate{min-height:50px!important;font-size:16px}
  .xs-library-sub{font-size:14px!important}
  .xs-search{height:46px!important}
  .xs-library-tools>select{height:44px!important}
  .xs-layout button{width:44px;height:44px}
  .xs-plan small,.xs-plan strong{font-size:13px}
  .sc-goals button,.sc-goals label{min-height:56px}
  .sc-goals b,.sc-goals strong{font-size:15px!important}
  .sc-goals small{font-size:13px!important}

  /* filtres « Toutes · En cours · … » : une rangée qui défile, jamais deux lignes */
  .xs-filters,.vp-filters,.set-nav,.bl-tags{flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;
    margin-left:-16px!important;margin-right:-16px!important;padding-left:16px!important;padding-right:16px!important;scroll-padding:0 16px}
  /* réglages : sur mobile, des puces qui défilent (le conteneur pilule du bureau couperait le texte) */
  .set-nav{width:auto!important;border:0!important;border-radius:0!important;background:none!important;gap:8px!important}
  .set-nav a{flex:none;min-height:40px;border:1px solid var(--border);background:var(--surface)}
  .xs-filters::-webkit-scrollbar,.vp-filters::-webkit-scrollbar,.set-nav::-webkit-scrollbar,.bl-tags::-webkit-scrollbar{display:none}
  .xs-filters button{font-size:14px!important;min-height:40px!important;padding:0 14px!important;flex:none;white-space:nowrap}
  .vp-chip-f{min-height:40px;font-size:14px;flex:none}

  /* cartes vidéo : actions lisibles et touchables */
  .xp-vtitle,.xs-dashboard .xp-vtitle{font-size:15px!important}
  .xp-vbody .btn{height:40px!important;min-height:40px!important;font-size:14px!important;padding:0 14px!important;border-radius:10px!important}
  .xp-vbody .btn .ic{display:inline-block!important;width:16px!important;height:16px!important}
  .xp-vbody .icon-btn,.xp-vbody [aria-haspopup]{width:40px;height:40px}
  .xs-dashboard .xp-empty-list .btn{font-size:15px!important;min-height:48px}
  .btn-sm{height:40px;font-size:14px}
  .icon-btn{width:40px;height:40px}

  /* ---- page vidéo (liste des clips) ---- */
  .vp-kpis{display:grid!important;grid-template-columns:1fr 1fr;overflow:visible!important;margin-right:0!important;padding-right:0!important}
  .vp-kpi{min-width:0!important}
  .vp-tc,.vp-c time{font-size:12px}

  /* ---- B-roll ---- */
  .bl-filters{display:grid!important;grid-template-columns:1fr 1fr;gap:10px}
  .bl-filters>input[type=search]{grid-column:1/-1}
  .bl-filters .input{width:100%;min-width:0;height:46px}
  .bl-filters label{min-height:44px;gap:8px}
  .bl-filters .btn{grid-column:1/-1;height:46px}
  .bl-pending{display:flex;flex-direction:column;gap:8px;padding:0;margin:8px 0 16px;list-style:none}
  .bl-pending li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid var(--border);border-radius:14px;background:var(--surface)}
  .bl-pending-t{flex:1;min-width:0;font-size:14px;white-space:normal;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .bl-pending li .btn{flex:none}

  /* ---- réglages : onglets en rangée, cibles et petits libellés ---- */
  .set-nav{gap:8px!important;font-size:15px!important}
  .set-nav>a{flex:none;white-space:nowrap;min-height:40px;display:inline-flex;align-items:center;padding:0 14px;border:1px solid var(--border);border-radius:999px}
  .set-sec label,.set-sec small,.set-sec .muted{font-size:13px}
  .set-sec button,.set-sec .btn{min-height:44px;min-width:44px}

  /* ---- connexion / inscription : marque en tête, carte à plat sur le fond ---- */
  .auth{margin:0 auto;padding:max(28px,env(safe-area-inset-top)) 20px 40px}
  .auth a.auth-brand.brand-logo{display:flex;width:max-content;margin:0 0 28px;font-size:22px}
  .auth>.card,.auth .card{border:0;box-shadow:none;background:transparent;padding:0}
  .auth h1{font-size:30px;letter-spacing:-.02em}
  .auth .btn{min-height:50px;font-size:16px}
  .auth label{font-size:14px}
  .auth-legal a,.auth .muted a{display:inline-block;padding:4px 0}

  /* ---- tarifs (modale et page) ---- */
  .seg button{min-height:44px}

  /* ---- éditeur Explainer : le titre prend sa ligne (il était coupé à « Sans t… »), les outils dessous ---- */
  .xp-bar{flex-wrap:wrap;row-gap:6px;height:auto!important;min-height:0!important}
  .xp-title-wrap{flex:1 1 calc(100% - 52px)!important}
  .xp-title{max-width:none!important;width:100%;font-size:17px!important;font-weight:600}
  .xp-bar .icon-btn,.xp-bar .btn-sm{min-width:44px;height:44px}
  main.container>h1{font-size:30px;letter-spacing:-.02em;line-height:1.15}
  .xs-toast,.toasts{bottom:calc(84px + env(safe-area-inset-bottom))}
}

/* ---- éditeur de clip au pouce : on l'affiche (avant : message « ouvre sur un grand écran ») ----
   Colonne unique : cadrage + lecture, timeline, outils IA, sous-titres…, export collé en bas d'écran. */
@media (max-width:720px){
  .ed-mobile{display:none!important}
  .editor{display:flex!important;flex-direction:column;align-items:stretch;gap:12px;min-height:0;padding-bottom:calc(96px + env(safe-area-inset-bottom))}
  main.container:has(>.editor),main.container:has(.editor){padding:10px 10px 0}
  .ed-left,.ed-right,.ed-top,.ed-top-col{width:100%;min-width:0}
  .ed-top{display:flex!important;flex-direction:column}
  .ed-card{padding:14px;border-radius:16px}
  .preview{width:100%}
  .crop-switch{overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap}
  .crop-switch::-webkit-scrollbar{display:none}
  .editor button:not(.ed-export){min-height:40px}
  .editor .icon-btn{min-width:40px}
  .editor input[type=range]{height:32px}
  /* pied d'export : barre fixe en bas d'écran (rendu Standard/Premium + bouton), au-dessus de la barre d'accueil iOS */
  .ed-foot{position:fixed!important;left:0!important;right:0!important;bottom:0!important;top:auto!important;z-index:30;display:flex!important;flex-direction:row!important;flex-wrap:wrap;align-items:center;gap:8px;margin:0!important;width:auto!important;
    padding:10px max(12px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
    background:color-mix(in srgb,var(--bg) 92%,transparent);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-top:1px solid var(--border);box-shadow:0 -8px 30px rgba(0,0,0,.08)}
  .ed-foot>*{flex:1 1 100%}
  .ed-foot>.ed-style{flex:0 0 auto;width:auto!important;align-self:stretch}
  .ed-foot .ed-style button{min-height:48px;padding:0 12px}
  .ed-foot>.ed-export{flex:1 1 0;min-width:0;width:auto!important;height:48px!important;font-size:16px!important;border-radius:14px;box-shadow:none}
  .ed-foot-more{display:none!important}
  .ed-foot .ed-compare{max-height:30vh;overflow:auto}
  .ed-foot>.mp-panel{order:-1;padding:8px;gap:6px;min-width:0;max-width:100%;box-sizing:border-box}
  .mp-panel .mp-cards{min-width:0}.mp-panel .ed-style-hint{display:none}
  .ed-foot:has(.mp-panel)>.ed-style{flex:1 1 100%}
  .ed-foot>.ed-export{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mp-head .muted{display:none}
  .mp-card{flex-basis:108px}.mp-line{display:none}
  .controls{flex-wrap:wrap;row-gap:2px}
  .controls .sep{display:none}
  .controls .time{white-space:nowrap;font-size:13px}
  .preview canvas{max-height:46vh!important}
  /* titre du clip : deux lignes au pouce (une seule coupait à « Naming a Moon Cra… ») */
  .ed-clip-title{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:18px}
}

/* ---- pages marketing (accueil, tarifs, toutes les pages sous la barre .mk-nav) : même règle, rien sous 13 px, cibles ≥ 44 px ----
   Sélecteurs doublés (.mk-nav.mk-nav…) comme dans marketing-shell.css, pour passer devant ses propres règles mobiles. */
@media (max-width:700px){
  .mk-nav.mk-nav .mk-logo,.mk-footer.mk-footer .mk-logo{min-height:44px}
  .mk-nav.mk-nav .mk-mobile-menu summary{min-width:44px;min-height:44px}
  .mk-nav.mk-nav .mk-mobile-heading{font-size:13px}
  .mk-nav.mk-nav .mk-mobile-resources a>span{font-size:15px}
  .mk-nav.mk-nav .mk-mobile-resources a,.mk-nav.mk-nav .mk-mobile-primary-links a{min-height:44px}
  .mk-nav.mk-nav .mk-mobile-account>a,.mk-nav.mk-nav .mk-mobile-account .mk-cta{min-height:48px;font-size:15px;padding-inline:16px}

  .eco-phones{gap:8px!important}
  .eco-phone{flex:1 1 0!important;min-width:0;border-width:4px!important}
  .eco-phone>span{font-size:13px!important;white-space:nowrap;left:4px!important;right:4px!important;bottom:4px!important;height:28px!important;padding:0 4px!important;overflow:hidden;text-overflow:ellipsis}
  .eco-product-tag em,.eco-product-tag{font-size:13px!important}
  .mk-extpop b,.mk-extpop span{font-size:13px!important}
  .eco-product-media pre code{font-size:13px!important}

  .seg button small{font-size:13px!important}
  .plan .plan-badge{font-size:13px!important}
  .plan .plan-price .cur{font-size:13px!important}
  .pricing-page>p.muted{font-size:14px!important}

  .mk-footer.mk-footer .mk-footer-main{grid-template-columns:1fr 1fr!important;gap:24px 16px}
  .mk-footer.mk-footer .mk-footer-brand>p{font-size:15px;line-height:1.5}
  .mk-footer.mk-footer .mk-contact{min-height:44px;font-size:15px}
  .mk-footer.mk-footer .mk-footer-group h2{font-size:14px;margin-bottom:4px}
  .mk-footer.mk-footer .mk-footer-group a{min-height:44px;font-size:15px;display:flex;align-items:center;align-self:stretch}
  .mk-footer.mk-footer .mk-footer-bottom>small{font-size:13px}
  .mk-footer.mk-footer .mk-footer-bottom>nav{gap:20px}
  .mk-footer.mk-footer .mk-footer-bottom>nav>a{min-height:44px;font-size:14px;display:inline-flex;align-items:center}
}

/* « Ajouter un média » : plein écran au pouce, réglages sous la grille, cibles 44 px */
@media (max-width:700px){
  .media-bg{align-items:stretch}
  .media-modal{width:100vw;max-width:100vw;max-height:100dvh;height:100dvh;border-radius:0;padding:14px max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}
  .media-head .btn-icon{width:44px;height:44px}
  .media-tabs button{min-height:44px;font-size:14px}
  .media-grid{grid-template-columns:repeat(2,1fr);max-height:none}
  .media-del{width:40px;height:40px}
  .media-settings{grid-template-columns:96px 1fr;gap:12px}
  .media-modes{grid-template-columns:1fr}
  .media-mode{flex-direction:row;justify-content:flex-start;text-align:left;min-height:52px}
  .media-mode .media-ico{flex:none}
  .media-actions{position:sticky;bottom:0;background:var(--bg-elev);padding-top:8px}
  .media-actions .btn{flex:1;min-height:48px}
  .broll-mode{height:40px}
}
